|
The following sections will describe how to convert statements that have no direct equivalent in LB.
DECLARE
Defines forward declarations of procedures. These are not needed in LB.
DIM SHARED
Declares global variables.
DIM SHARED variablelist
Code: | Global variablelist |
DEF FN
Defines a simple function.
DEF FNname(parameterlist) = expression
Code: | Function FNname(parameterlist)
FNname = expression
End Function |
While many DOS BASICs require DEF FN's to be placed near the beginning of a program, LB functions must be placed near the end.
ERASE
Frees the memory allocated to an array.
ERASE arrayname
ON...GOSUB and ON...GOTO
Causes execution to jump to one of a list of line numbers/labels based on the value of an expression.
ON expression GOSUB label1, label2, ...
ON expression GOTO label1, label2, ...
Code: | Select Case expression
Case 1
' GoSub/GoTo [label1] or just inline code here
Case 2
' Ditto for [label2]
' ...
End Select |
|
|
|