|
Authored by: Anonymous on Saturday, May 19 2012 @ 06:59 AM EDT |
All advanced Basic programs have a GOTO statement.
In
compiling its programs Pick DataBASIC converts all structured programming
structures into GOTOs;
-
a FOR-NEXT checks the condition at the beginning
and if false GOTOs the instruction after the NEXT, which itself is replaced with
a GOTO to the loop condition check at the beginning of the loop;
-
a
LOOP-WHILE/UNTIL_cond_DO-REPEAT becomes a IF THEN GOTO at the WHILE/WHILE
statement, going to the instruction after the REPEAT, which itself becomes a
GOTO the LOOP keyword (which itself is actually just removed from the byte code)
[jumping in/out of LOOP...REPEAT blocks is very nasty coding but will compile to
perfectly legal byte code and causes no memory problems];
- IF-THEN-ELSE
becomes IF false GOTO "else" block followed by the "then" block which is ended
by a GOTO end of "else" block, followed by the "else" block.
So even
if the GOTO keyword is not used by a programmer, the dataBASIC compiler itself
can use a lot of them.[ Reply to This | Parent | # ]
|
|
|
|
|