UserGuide - Variables and Processing of variables
A is an integer - but note that you can't declare variables this way if you use the EnableExplicit directive. Outside of a procedure A will exist at Main scope, within a procedure it will become local.A = 0
Define B.l, C.f
Define.l D = 10, E = 20
Define.s F
G$ = "Hello, "This won't work. (G becomes a new integer variable and a compiler error occurs).
G = "Goodbye, World!"
Dim H.s(19)Now H is an array of 25 strings. If the array is resized larger, its original contents will be preserved.
ReDim H.s(24)
Global.i J
NewList K.s()
NewMap M.s()
Procedure TestVariables() ; N and P will be local. Define.l N Protected.l P ; Q will be a static local. Static.l Q ; The main scope variable F and the string list K will be available within this procedure. Shared F, K() ; The global scope variable J will be available here implicitly. EndProcedure
; Add two to A. A + 2 ; Bitwise Or with 21 (A will become 23) A | 21 ; Bitwise And with 1 (A will become 1) A & 1 ; Arithmetic shift left (A will become 2, that is 10 in binary). A << 1
G$ + "World!"
AddElement(K()) K() = "List element one"
M("one") = "Map element one"
UserGuide Navigation
< Previous: First steps | Overview | Next: Constants >