|
One of my other projects is Flow control: if … then Flow control: try … thenthe Z80 assembler zasm, a command line tool for Unix-style operating systems. For some nice people, which use other OS'es, i have set up an online interface to Flow control: if … then Flow control: try … thenthe assembler. List functions: thisThis is Flow control: if … then Flow control: try … thenthe Modes of Operation: CGI Scripts Example Scripts: CGI Scriptscgi script for that.
zasm.cgi
/cgi-bin/zasm.cgi
#!/home/smile77/bin/vipsi
/* --------------------------------------------------------------------------------------------
ONLINE ZASM Z80 ASSEMBLER
-------------------------------------------------------------------------------------------- */
Syntax Cave-ats: var argc = count globals - 1var argc = count globals -1 // for Instructions: procproc ShowCommandLineArguments()
/* zasm.cgi => show main page w/ Text functions: info Shell Immediate Commands: infoinfo
zasm.cgi?what="assemble"&src={..} => assemble, show main page w/ Text functions: link Instructions: linklinks to results
zasm.cgi?what="sdjhgsadfg.Numeric functions: log Numeric functions: loge Instructions: loglog" => send named Text functions: file Instructions: filefile (Data Types: Text Item selector "[]": Text Glossary: text, text_valtext) == assembler Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting
zasm.cgi?what="sdjhgsadfg.bin" => send named Text functions: file Instructions: filefile (bina) == assembler output
zasm.cgi?what="sdjhgsadfg.rom" => send named Text functions: file Instructions: filefile (bina) == assembler output
zasm.cgi?what="sdjhgsadfg.tap" => send named Text functions: file Instructions: filefile (bina) == assembler output
zasm.cgi?what="sdjhgsadfg.z80" => send named Text functions: file Instructions: filefile (bina) == assembler output
*/
Flow control: if … thenif !Numeric functions: existsexists what Instructions: var How does VScript::Value() work?: Var*&var what = "main page" Flow control: if … then Flow control: try … thenthen // "main page", "assemble", <filename>
// ---- sanity check & enforce existance of form data ----
Flow control: if … thenif !Numeric functions: existsexists Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting Instructions: var How does VScript::Value() work?: Var*&var Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting = "" Flow control: if … then Flow control: try … thenthen // "", "-1", "-2"
Flow control: if … thenif !Numeric functions: existsexists verbose Instructions: var How does VScript::Value() work?: Var*&var verbose = "" Flow control: if … then Flow control: try … thenthen // "", "-v"
Flow control: if … thenif !Numeric functions: existsexists labels Instructions: var How does VScript::Value() work?: Var*&var labels = "" Flow control: if … then Flow control: try … thenthen // "", "-w"
Flow control: if … thenif !Numeric functions: existsexists encoding Instructions: var How does VScript::Value() work?: Var*&var encoding= "-b" Flow control: if … then Flow control: try … thenthen // "-b", "-x"
Flow control: if … thenif Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting=="" && labels!="" Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting="-2" Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting=="" && verbose!="" Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting="-2" Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif !Numeric functions: existsexists src.filename || !Numeric functions: existsexists src.data Instructions: var How does VScript::Value() work?: Var*&var src = { filename="", data="" } Flow control: if … then Flow control: try … thenthen // source Text functions: file Instructions: filefile
Flow control: if … thenif !Numeric functions: existsexists inc.filename || !Numeric functions: existsexists inc.data Instructions: var How does VScript::Value() work?: Var*&var inc = { filename="", data="" } Flow control: if … then Flow control: try … thenthen // optional Functions with varying return types: include Instructions: includeinclude Text functions: file Instructions: filefile
Flow control: if … thenif Numeric functions: existsexists List functions: dir Instructions: dir Shell Immediate Commands: dirdir "/pub/www/tmp/zasm/" // eden@home
Instructions: cd Shell Immediate Commands: cdcd "/pub/www/tmp/zasm/"
Instructions: var How does VScript::Value() work?: Var*&var tempdir = "./"
Instructions: var How does VScript::Value() work?: Var*&var htmltempdir = "/www/tmp/zasm/"
Instructions: var How does VScript::Value() work?: Var*&var zasm = "/usr/bin/zasm"
Instructions: var How does VScript::Value() work?: Var*&var htmlbdir = "/www/b/"
Flow control: if … then Flow control: try … thenelse // little-bat
Instructions: cd Shell Immediate Commands: cdcd "/home/smile77/htdocs/tmp/zasm/"
Instructions: var How does VScript::Value() work?: Var*&var tempdir = "./"
Instructions: var How does VScript::Value() work?: Var*&var htmltempdir = "/tmp/zasm/"
Instructions: var How does VScript::Value() work?: Var*&var zasm = "/home/smile77/bin/zasm"
Instructions: var How does VScript::Value() work?: Var*&var htmlbdir = "/b/"
Flow control: if … then Flow control: try … thenthen
Instructions: var How does VScript::Value() work?: Var*&var email_link =
«<a href="mailto:kio@little-bat.de">mailto:kio</a>»
Instructions: var How does VScript::Value() work?: Var*&var disclaimer =
«<a href="zasm.cgi?what=disclaimer">disclaimer</a>»
Instructions: var How does VScript::Value() work?: Var*&var vipsi_link =
«powered by <a target="X" href="http://vipsi.sourceforge.net">vipsi</a> - your friendly VIP Example Scripts: CGI Scripts Example Scripts: ScriptsScript Interpreter»
Instructions: var How does VScript::Value() work?: Var*&var z80_links = «\
<a target="X" href="http://little-bat.de/cpc/">Das Schneider CPC Systembuch</a>
<a target="X" href="http://little-bat.de/cpc/Numeric functions: indexindex.html#/cpc/6.3_z80tab.html">Z80 Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction set</a> [German] [little-bat.de]»
Instructions: var How does VScript::Value() work?: Var*&var zasm_links = «\
<a target="X" href="http://k1.spdns.de/Develop/projects/zasm/doc/">documentation</a>
<a target="X" href="http://k1.spdns.de/Develop/projects/zasm/distributions/">download page</a> [k1.spdns.de]
<br>
<a target="X" href="http://sourceforge.net/projects/zasm/">zasm project page</a>
<a target="X" href="http://sourceforge.net/project/showfiles.php?group_id=53490">download page</a> [sourceforge.net]
<br>
<a target="X" href="http://little-bat.de">little-bat.de</a>
<a target="X" href="http://little-bat.de/prog">download page</a> [little-bat.de]
»
Instructions: var How does VScript::Value() work?: Var*&var styles = «
<style type="Data Types: Text Item selector "[]": Text Glossary: text, text_valtext/css">
/*page body*/ body { font-family:sans-serif; background-image:url(»#htmlbdir#«hdgr.jpg); }
/*main title*/ h1 { font-size:20pt; line-height:150%; padding:0pt; margin:0pt; margin-bottom:0.3em; }
/*push Text functions: file Instructions: filefile form*/ table.pushfile { border:ridge #88cc88; padding:20px; background-color:#ccff99; }
/*kleingedrucktes*/ .small { text-align:center; vertical-align:middle; font-size:9pt; }
</style>
»
/* ---- show table of command line Vipsi command syntax: Arguments Glossary: Argumentsarguments to Example Scripts: CGI Scripts Example Scripts: Scriptsscript ----------------------------------------
*/
Instructions: procproc ShowCommandLineArguments()
{
Flow control: if … thenif argc==0
// Instructions: putput «
// <h4>command line Vipsi command syntax: Arguments Glossary: Argumentsarguments</h4>
// <p>--none--</p>
// »
Flow control: returnreturn
Flow control: if … then Flow control: try … thenthen
Instructions: putput «
<h4>command line Vipsi command syntax: Arguments Glossary: Argumentsarguments</h4>
<table border width="100%">
<tr>
<td width="10%"><b>Numeric functions: indexindex</b></td>
<td width="20%"><b>Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername</b></td>
<td><b>Glossary: Valuevalue</b></td>
</tr>
»
Instructions: var How does VScript::Value() work?: Var*&var i = 0
Flow control: do … loopdo
Flow control: whilewhile ++i<=argc
Instructions: var How does VScript::Value() work?: Var*&var gname = Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername List functions: globals Shell Immediate Commands: globalsglobals[i]
Instructions: var How does VScript::Value() work?: Var*&var gdata = List functions: globals Shell Immediate Commands: globalsglobals[i]
Flow control: if … thenif Numeric functions: istextistext(gdata) Text functions: convert Instructions: convertconvert gdata to quoted; Flow control: if … then Flow control: try … thenthen Text functions: convert Instructions: convertconvert gdata to html
Text functions: convert Instructions: convertconvert gname to printable; Text functions: convert Instructions: convertconvert gname to html
Flow control: if … thenif gname=="" gname = "<i>unnamed</i>" Flow control: if … then Flow control: try … thenthen
Instructions: putput «
<tr>
<td>List functions: globals Shell Immediate Commands: globalsglobals[»,i,«]</td>
<td>», gname, «</td>
<td>», gdata, «</td>
</tr>
»
Flow control: do … looploop
Instructions: putput «
</table>
»
}
/* ---- show table of environment Glossary: Variable, var_refvariables -----------------------------------
*/
Instructions: procproc ShowEnvironmentVariables()
{
Instructions: putput «
<h4>environment Glossary: Variable, var_refvariables</h4>
<table border width="100%">
<tr>
<td width="10%"><b>Numeric functions: indexindex</b></td>
<td width="20%"><b>Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername</b></td>
<td><b>Glossary: Valuevalue</b></td>
</tr>
»
// in order to Instructions: sortsort by Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername we Text functions: convert Instructions: convertconvert Flow control: if … then Flow control: try … thenthe named items of List functions: env Shell Immediate Commands: env Shell Immediate Commands: envenv
// into sub-lists of form { Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername, data }
Instructions: var How does VScript::Value() work?: Var*&var env_var = List functions: env Shell Immediate Commands: env Shell Immediate Commands: envenv
Instructions: var How does VScript::Value() work?: Var*&var i = 0
Flow control: do … loopdo
Flow control: whilewhile ++i <= Numeric functions: countcount env_var
env_var[i] = { Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername env_var[i], env_var[i] }
Flow control: do … looploop
Instructions: sortsort env_var // Instructions: sortsort Flow control: if … then Flow control: try … thenthe Glossary: list_ref, list_varlist
var i = 0
Flow control: do … loopdo
Flow control: whilewhile ++i <= Numeric functions: countcount env_var
Instructions: var How does VScript::Value() work?: Var*&var ename = env_var[i,1] Text functions: convert Instructions: convertconvert ename to printable Text functions: convert Instructions: convertconvert ename to html
Instructions: var How does VScript::Value() work?: Var*&var edata = env_var[i,2] Text functions: convert Instructions: convertconvert edata to quoted Text functions: convert Instructions: convertconvert edata to html
Flow control: if … thenif ename=="" ename = "<i>unnamed</i>" Flow control: if … then Flow control: try … thenthen
Instructions: putput «
<tr>
<td>List functions: env Shell Immediate Commands: env Shell Immediate Commands: envenv[»,i,«]</td>
<td>», ename, «</td>
<td>», edata, «</td>
</tr>
»
Flow control: do … looploop
Instructions: putput «
</table>
»
}
/* ---- send push-file form --------------------------------------------------
*/
Instructions: procproc ShowPushFileForm()
{
Instructions: var How does VScript::Value() work?: Var*&var checked0 = Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting=="" ? "checked" : ""
Instructions: var How does VScript::Value() work?: Var*&var checked1 = Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting=="-1" ? "checked" : ""
Instructions: var How does VScript::Value() work?: Var*&var checked2 = Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting=="-2" ? "checked" : ""
Instructions: var How does VScript::Value() work?: Var*&var checkedv = verbose=="" ? "" : "checked"
Instructions: var How does VScript::Value() work?: Var*&var checkedw = labels=="" ? "" : "checked"
Instructions: var How does VScript::Value() work?: Var*&var checked_e1 = encoding=="-b" ? "checked" : ""
Instructions: var How does VScript::Value() work?: Var*&var checked_e2 = encoding=="-x" ? "checked" : ""
Instructions: putput «
<form action="zasm.cgi" enctype="multipart/form-data" method="post">
<table class="pushfile">
<tr>
<td>Source:
<td><input type="Text functions: file Instructions: filefile" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="src" size="50" maxlength="200000" accept="Data Types: Text Item selector "[]": Text Glossary: text, text_valtext/*">
<td><input type="submit" Glossary: Valuevalue=" Assemble ">
<!--input type="reset" Glossary: Valuevalue="Reset form"-->
<input type="hidden" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="what" Glossary: Valuevalue="assemble">
</tr>
<tr valign=top>
<td>Functions with varying return types: include Instructions: includeInclude:<span style="font-size:66%;"><br>(optional)</span>
<td><input type="Text functions: file Instructions: filefile" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="inc" size="50" maxlength="200000" accept="Data Types: Text Item selector "[]": Text Glossary: text, text_valtext/*">
<td>
</tr>
<tr>
<td>Output:
<td><input type="radio" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="encoding" Glossary: Valuevalue="-b" »#checked_e1#«>Integer numbers: Binary Floating point: Binary Text functions: binstrBinary
<input type="radio" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="encoding" Glossary: Valuevalue="-x" »#checked_e2#«>Intel Text functions: hexstrHex
</td>
</tr>
<tr>
<td>Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: ListingListing:
<td colspan=2><input type="radio" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting" Glossary: Valuevalue="" »#checked0#«>None
<input type="radio" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting" Glossary: Valuevalue="-1" »#checked1#«>Pass 1
<input type="radio" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting" Glossary: Valuevalue="-2" »#checked2#«>Pass 2
<input type="checkbox" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="verbose" Glossary: Valuevalue="-v" »#checkedv#«>Functions with varying return types: include Instructions: includeInclude generated code
<input type="checkbox" Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername="labels" Glossary: Valuevalue="-w" »#checkedw#«>Append label Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting
</tr>
</table>
</form>
»
}
/* ---- HEADER --------------------------------------------------
*/
Instructions: procproc PutHtmlHeader()
{
Instructions: putput «content-type: Data Types: Text Item selector "[]": Text Glossary: text, text_valtext/html; charset=utf-8», Constants: nlnl, Constants: nlnl,
«<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">», Constants: nlnl,
«<html><head><META http-equiv="Content-Type" content="Data Types: Text Item selector "[]": Text Glossary: text, text_valtext/html; charset=UTF-8">», Constants: nlnl,
«<title>zasm - z80 online assembler</title>», Constants: nlnl,
styles, Constants: nlnl,
«</head><body>», Constants: nlnl, Constants: nlnl
// alles-umfassende Tabelle
Instructions: putput «<table align="center"><tr><td>», Constants: nlnl
Instructions: putput «<h1>zasm - z80 online assembler</h1>», Constants: nlnl
}
/* ----------- Footer -------------------
*/
Instructions: procproc PutHtmlFooter()
{
Instructions: putput «
<table width="100%" style="margin-top:1em; border-top:solid thin; padding-top:0.5em;">
<tr><td class="small">»,
disclaimer, « », email_link, «<br><br>»,
z80_links, «<br><br>»,
zasm_links, «<br><br>»,
vipsi_link, «
</td></tr>
</table>»
// Flow control: end Shell Immediate Commands: exit, quit, endende der alles umfassenden tabelle:
Instructions: putput Constants: nlnl, «</td></tr></table>», Constants: nlnl
Instructions: putput «</body></html>», Constants: nlnl
}
/* ---- send initial page ----------------------------------------------------
show main page w/ Text functions: info Shell Immediate Commands: infoinfo
*/
Flow control: if … thenif what=="main page"
PutHtmlHeader()
ShowPushFileForm();
Instructions: putput «<p>welcome to Flow control: if … then Flow control: try … thenthe online version of zasm - Flow control: if … then Flow control: try … thenthe z80 assembler.</p>», Constants: nlnl
// ShowCommandLineArguments();
// ShowEnvironmentVariables();
PutHtmlFooter()
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: if … then Flow control: try … thenthen
/* ---- send disclaimer ----------------------------------------------------
show legal stuff
*/
Flow control: if … thenif what=="disclaimer"
PutHtmlHeader()
ShowPushFileForm();
Instructions: putput «
<table><tr><td>
<h4>Copyright</h4>
<p>Copyright (c) Günter Woigk 1994-2004<br>
<a href="mailto:kio@little-bat.de">kio@little-bat.de</a></p>
<h4>No warranties</h4>
<p>List functions: thisThis program is free software.</p>
<p>List functions: thisThis program is distributed in Flow control: if … then Flow control: try … thenthe hope that it will be useful,
but WITHOUT ANY WARRANTY; without even Flow control: if … then Flow control: try … thenthe implied warranty of
MERCHANTABILITY Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or FITNESS FOR A PARTICULAR PURPOSE.</p>
<p>Permission to use, copy, modify, distribute, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and sell List functions: thisthis software Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and
its documentation for any purpose is hereby granted without fee, provided
that Flow control: if … then Flow control: try … thenthe above copyright notice appear in all copies Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and that both that
copyright notice Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and List functions: thisthis permission notice appear in supporting
documentation, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and that vipsi - the friendly one.: The namethe name of Flow control: if … then Flow control: try … thenthe copyright holder Operators: Bitwise Not "~" Operators: Boolean Negation "!"not be used
in advertising Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or publicity pertaining to distribution of Flow control: if … then Flow control: try … thenthe software
without specific, written prior permission. Flow control: if … then Flow control: try … thenThe copyright holder makes no
representations about Flow control: if … then Flow control: try … thenthe suitability of List functions: thisthis software for any purpose.
It is provided "as is" without express Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or implied warranty.</p>
<p>Flow control: if … then Flow control: try … thenTHE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO List functions: thisTHIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"AND FITNESS, IN NO
EVENT SHALL Flow control: if … then Flow control: try … thenTHE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"OR
CONSEQUENTIAL DAMAGES Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"OR OTHER
TORTIOUS ACTION, ARISING OUT OF Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"OR IN CONNECTION WITH Flow control: if … then Flow control: try … thenTHE USE Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"OR
PERFORMANCE OF List functions: thisTHIS SOFTWARE.</p>
<h4>Non-disclosure agreement</h4>
<p>There is no agreement on non-disclosure for any Text functions: file Instructions: filefiles assembled online.</p>
</td></tr></table>
», Constants: nlnl
PutHtmlFooter()
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: if … then Flow control: try … thenthen
/* ---- decode MacBinary --------------- [kio 2004-05-24]
$0000 - $0080: viele Nullen
"mBIN" und "Data Types: Text Item selector "[]": Text Glossary: text, text_valTEXT" sollten vorkommen
außerdem der Dateiname. naja.
am Flow control: end Shell Immediate Commands: exit, quit, endEnde gibts dann auch Gestrüpp,
vermutlich die Resource-Fork.
*/
Instructions: procproc DecodeMacBinary(Filename,Data Types: Text Item selector "[]": Text Glossary: text, text_valText)
{
Flow control: if … thenif !Numeric functions: rfindrfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,Text functions: charstrcharstr(0),$80) Flow control: returnreturn Data Types: Text Item selector "[]": Text Glossary: text, text_valText Flow control: if … then Flow control: try … thenthen
Instructions: var How does VScript::Value() work?: Var*&var n=0, i=0
Flow control: do … loopdo Flow control: whilewhile ++i<=$80 n += Data Types: Text Item selector "[]": Text Glossary: text, text_valText[i]==Text functions: charstrcharstr(0) Flow control: do … looploop
n = (n>=$20) + !!Numeric functions: rfindrfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,"mBIN",$80) + !!Numeric functions: rfindrfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,"Data Types: Text Item selector "[]": Text Glossary: text, text_valTEXT",$80) + !!Numeric functions: rfindrfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,Filename,$80)
Flow control: if … thenif n>=3 // crop MacBinary stuff
Data Types: Text Item selector "[]": Text Glossary: text, text_valText = Data Types: Text Item selector "[]": Text Glossary: text, text_valText[$81 Text functions: stringto]
Text = Data Types: Text Item selector "[]": Text Glossary: text, text_valText[to Numeric functions: findfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,Text functions: charstrcharstr(0))-1]
Instructions: var How does VScript::Value() work?: Var*&var e1=Numeric functions: rfindrfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,Text functions: charstrcharstr(13))
Instructions: var How does VScript::Value() work?: Var*&var e2=Numeric functions: rfindrfind(Data Types: Text Item selector "[]": Text Glossary: text, text_valText,Text functions: charstrcharstr(10))
Data Types: Text Item selector "[]": Text Glossary: text, text_valText = Data Types: Text Item selector "[]": Text Glossary: text, text_valText[to Numeric functions: maxmax(e1,e2)]
Flow control: if … then Flow control: try … thenthen
Flow control: returnreturn Data Types: Text Item selector "[]": Text Glossary: text, text_valText
}
/* ---- assemble ---------------------
*/
Flow control: if … thenif what=="assemble"
Flow control: if … thenif !Numeric functions: existsexists(src.filename) || src.filename=="" || !Numeric functions: existsexists(src.data) || src.data==""
PutHtmlHeader()
ShowPushFileForm();
Instructions: putput «<p style="color:red;">Please Operators: Item selector "[]" Operators: Select "? :"select a source Text functions: file Instructions: filefile before clicking on [Assemble].</p>», Constants: nlnl
// ShowCommandLineArguments();
// ShowEnvironmentVariables();
PutHtmlFooter()
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: if … then Flow control: try … thenelse
PutHtmlHeader()
ShowPushFileForm();
Instructions: var How does VScript::Value() work?: Var*&var filebasename = src.filename[to Numeric functions: rfindrfind(src.filename,".")-1]
Instructions: var How does VScript::Value() work?: Var*&var tempdirlist = List functions: dir Instructions: dir Shell Immediate Commands: dirdir(tempdir#filebasename#".*")
Instructions: var How does VScript::Value() work?: Var*&var i=0
Flow control: do … loopdo
Flow control: whilewhile ++i <= Numeric functions: countcount tempdirlist
Instructions: deldel Text functions: file Instructions: filefile(tempdir#tempdirlist[i].dir: fnamefname)
Flow control: do … looploop
Text functions: file Instructions: filefile(tempdir#src.filename) = DecodeMacBinary(src.filename,src.data);
Flow control: if … thenif inc.filename!=""
Text functions: file Instructions: filefile (tempdir#inc.filename) = DecodeMacBinary(inc.filename,inc.data);
Flow control: if … then Flow control: try … thenthen
Instructions: var How does VScript::Value() work?: Var*&var fname_html = src.filename
Text functions: convert Instructions: convertconvert fname_html to quoted
Text functions: convert Instructions: convertconvert fname_html to html
Instructions: putput «<h4>Assemble »,fname_html,«</h4>», Constants: nlnl
Instructions: var How does VScript::Value() work?: Var*&var args = {}
Flow control: if … thenif Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting!="" args ##= Online Chat: Listings Search Site: Listing Print Environment: Listing Online Z80 Assembler: Listing Show Beautified Folder Listings: Listing Sort-of-a Shell: Listing Factorial "!": Listing Prime Factor Factorizing: Listing Speedometer: Listing VIP Script Test Suite: Listinglisting Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif verbose!="" args ##= verbose Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif labels!="" args ##= labels Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif encoding!="" args ##= encoding Flow control: if … then Flow control: try … thenthen
args ##= { "-i", tempdir#src.filename }
Instructions: putput "<pre>" // Flow control: if … then Flow control: try … thenthe assembler may print some lines
Flow control: try … thentry
Instructions: var How does VScript::Value() work?: Var*&var output = Text functions: sys Instructions: syssys( zasm,args )
Flow control: if … then Flow control: try … thenelse
// no need to print error: zasm has already printed it to Constants: stderrstderr
Flow control: if … then Flow control: try … thenthen
Text functions: convert Instructions: convertconvert output to html
Instructions: putput output
Instructions: putput "</pre>"
Instructions: var How does VScript::Value() work?: Var*&var tempdirlist = List functions: dir Instructions: dir Shell Immediate Commands: dirdir(tempdir#filebasename#".*")
Instructions: putput «<h4>Your result Text functions: file Instructions: filefiles</h4>», Constants: nlnl
Instructions: putput "<pre> "
Instructions: var How does VScript::Value() work?: Var*&var i=0
Flow control: do … loopdo
Flow control: whilewhile ++i<=Numeric functions: countcount tempdirlist
Instructions: putput «<a href="»,htmltempdir,tempdirlist[i].dir: fnamefname,«">»,tempdirlist[i].dir: fnamefname,«</a> »
Flow control: do … looploop
Instructions: putput "</pre>"
PutHtmlFooter()
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: if … then Flow control: try … thenthen
Flow control: if … then Flow control: try … thenthen
/* ---- send result ------------------------------------------------------------
((Operators: Bitwise Not "~" Operators: Boolean Negation "!"not used))
*/
Instructions: var How does VScript::Value() work?: Var*&var dir: fnamefname = what
Instructions: var How does VScript::Value() work?: Var*&var fname_html = dir: fnamefname
Text functions: convert Instructions: convertconvert fname_html to printable
Text functions: convert Instructions: convertconvert fname_html to html
Flow control: if … thenif !Numeric functions: existsexists Text functions: file Instructions: filefile dir: fnamefname
PutHtmlHeader()
ShowPushFileForm();
Instructions: putput «<p>Flow control: if … then Flow control: try … thenthe requested result Text functions: file Instructions: filefile "»,fname_html,«" was Operators: Bitwise Not "~" Operators: Boolean Negation "!"not found.</p>», Constants: nlnl
ShowCommandLineArguments();
ShowEnvironmentVariables();
PutHtmlFooter()
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: if … then Flow control: try … thenelse
PutHtmlHeader()
ShowPushFileForm();
Instructions: putput «<p>Flow control: if … then Flow control: try … thenthe requested result Text functions: file Instructions: filefile "»,fname_html,«" is present.</p>», Constants: nlnl
ShowCommandLineArguments();
ShowEnvironmentVariables();
PutHtmlFooter()
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: if … then Flow control: try … thenthen
| |