Content deleted Content added
mNo edit summary |
|||
Line 26:
Programs in Zgrass were referred to as "macros", and stored as strings. Both of these oddities were deliberate, as Zgrass allowed any string to become a program. For instance, <code>MYBOX="BOX 0,0,100,100,2"</code> defines a string (no need for a $ as in BASIC) containing a snippet of Zgrass code. Simply typing <code>MYBOX</code> from that point on would run the command(s) inside. This feature can be used in place of the more traditional <code>[[GOSUB]]</code> command from BASIC, but has the added advantage of having a well defined name as opposed to an opaque line number. In addition the command remains a string, and can be manipulated at runtime with standard string operations.
Most BASIC [[interpreter (computer software)|interpreters]] of the era converted the input text into a
Line numbers were optional in Zgrass, and typically only appeared on lines that were the target of a <code>GOTO</code>. Most BASIC interpreters required line numbers for every line of code, but this was due to their use in the "line editor"–if you needed to edit ''that'' line, the only way to refer to it was by number. Zgrass used a more advanced full-screen editor that eliminated this need.<ref group=notes>As was the case for [[True BASIC]] and most dialects after that time.</ref> Zgrass allowed any string to act as a "line number", <code>GOTO 10</code> and <code>GOTO MARKER</code> were both valid. Zgrass also included nameless branches, using the <code>SKIP</code> instruction, which would move forward or back a given number of lines.
|