local
Die LOCAL-Anweisung deklariert eine Variable im aktuellen Stapelrahmen. Die Variable wird automatisch aus dem Speicher entfernt, wenn der Stapelrahmen nach dem Funktionsaufruf aufgelöst wird. Die Variable ist nur im aktuellen Stapelrahmen sichtbar.
1
2
3
4
5
6
7
8
9
LOCAL i
i = 10
DO someFunction
FUNCTION someFunction
? i
ENDFUNC
(Runtime error) 12 - Variable 'I' is not found.
in /runtime/builddir/runme.prg, line 8, column 5, program someFunction
(Stack trace)
#002 in /runtime/builddir/runme.prg, line 8, column 5, program someFunction
#001 in /runtime/builddir/runme.prg, line 5, column 1, program runme
Variable 'I' is not found.
Unicode Bezeichner
Mit DO können Unicode-Zeichen zum bezeichnen von Variablen
verwendet werden:
1
2
3
4
5
LOCAL 可變
FOR 可變 = 1 TO 3
? "變數內容", 可變
ENDFOR
變數內容 1
變數內容 2
變數內容 3