[Features] Comments are put in.
[Format] REM [sentence]
The following sentence isn't executed.
It is omissible by (').
[Features] To assign the value to a variable.
[Format] [LET] variable[$]=value
'let' is omissible. (In SQL mode, it isn't omissible.)
Capital letter and Small letter are distinguished and are processed as another variable.
Please also read "[func]statement-Notes of global variable definition position."
dim d(4) : d(0)=8
hello 2 4 8
[Features] Arrays variable is declared.
[Format] DIM variable[$](a[,b][,c]...) [,variable[$]...]
Subscripts(a[,b][,c]...) are specified.
Multidimensional array is possible.
Range that can be used is (0~subscript)
When it is character array, attach '$' in the variable name.
[Features] To eliminate arrays from a program.
[Format] ERASE variable[$][,variable[$]]...
What can be erased is a variable which can be referred to with the current scope.
[Features] To store the numeric and string that are accessed by 'READ'statement.
[Format] DATA data1[,data2]...
'DATA'statement can be placement anywhere.
Character string data, Form enclosed in double quotation, it is not, either is OK.
10 read a,b
20 print a;b
30 read s1$,s2$
40 print s1$;s2$
50 print "Line:";dtl
60 restore 120
70 read s1$,s2$
80 print s1$;s2$
100 data 10,11,12,abc
110 data 20,21,22
120 data Apple,"Orange"
[Features] To read values from 'DATA'statement and assign them to variables.
[Format] READ variable[$][,variable[$]]...
The character variable can read the data of both numerical value and character string.
In a numeric variable, it can read only numeric data.
[Features] To specification the line number of 'DATA' accessed by 'READ'.
[Format] RESTORE [linenumber]
If a line number is omitted, it will become a head position of data.
[Features] The line number read in the 'READ'statement is held and returned.
if dtl=500 then restore
[Features] It swap the values of two numeric variables.
[Format] SWAP (array)variable1, (array)variable2
It can be used for array variable.
(with number of arrangement element)
[Features] To find specified 'search value' from numeric array variable, and return the 'subscript-number'.
[Format] SEARCH( Numeric-array-variable-name,search-value[,start-subscript[,step-value]] )
To find specified 'search value' from numeric array variable and return the 'subscript-number'.
If not found, it return -1.
Array variables must be primary array.
It must be declared by 'DIM' beforehand.
It specify at 'start-subscript' for 'where to start searching'.
The default is 0.
Specifying 'step value' is looking for at the interval.
The default is 1.
[Features] The numeric value variable is formed within specified range.
[Format] RANGE (array)variable, min, max, [L]
When the value of variable is smaller than 'min' of specified,
it's formed into 'min', bigger than 'max' then it's formed into 'max'.
Also be able to use array variable of numerical. (specifying subscript)
When 'L' switch is specified (lower case OK),
'min' & 'max' is regarded with connected like loop form,
and the overflowing portion is added to the reverse side, the value is formed.
num=120: range num,-50,100: print num
num=120: range num,-50,100,l: print num
[Features] All Variable initialization, and Area size of (string & numeric)variable are determined.
[Format] CLEAR [string-variable-area-size] [,numeric-variable-area-size]
All the variables are initialized. (in the same state as startup)
Opened files are closed.
All the interruption will be in OFF state.
Random generator series is initialized.
In the state of the first, String - 4000, Numeric - 100000.
String variable have another actual data store area separate from this value.
(The length of one string is free)
The omitted will keep the previous values.
'Immediately after specifying, the array of size can be defined at the maximum.
[Features] To return the address of a variable stored in the variable area.
It is used in combination with 'BSAVE','BLOAD',
and be used to Into & out of numeric array variable.
100 dim az(12)
120 bsave "da.dat",varptr("az")
130 erase az
140 dim az(12)
150 bload "da.dat",varptr("az")
160 print az(0)
170 print az(1)
180 print az(2)
[Features] Data of variable area of memory is saved at a file.
[Format] BSAVE "file-name",variable-area-address
The address of numerical array to save is specified using 'VARPTR' function.
The value of array is a decimal omitted,
and changed into 2-byte signed integer, and be saved.
The kind, can be saved is only numerical array.
The length of the array end is determined automatically.
bsave "sh.var",varptr("sh")< BR>
[Features] Data is read into the variable area of memory from a file.
[Format] BLOAD "file-name",variable-area-address
The address of numerical array to load is specified using 'VARPTR' function.
Array to be read must be the same size as it is saved.
bload "gd.var",varptr("gd")< BR>