Text commands
- var name[[size]][$] - declares variable, optional argument size creates table.
var number
var string$="text"
var array[500]
var stringarray[10]$
- let name=[data] - imputes data to variable.
let x[3]=5
let x$="one"+"two"
- print [data];[data]... - prints variables, semicolon links data.
print "x=";x;"."
- input [question];[var] - reads data to variable.
input "Enter number:";x
- clr - clears screen.
- if [exp] then [command] - if statement, example: if x > 5 then print \"Is greater\".
- else [command] - extecutes [command] if previous if statement was false.
- mark [label] - marks position, use with goto.
mark loop
- goto [label] - goes to previously marked position.
goto loop
- for [var]=[val] to [end var] - imputes [val] to [var] and executes the loop until [var] is equal to [end var].
for x=0 to 10
- next [var] - causes a incrementation of [var] and proceeding in loop.
next x
- gosub [label] - goes to previously marked subroutine.
gosub func
- return - returns from subroutine.
Graphic commands
- gclr - clears screen.
- rect x, y, width, height, fill, [color] - draws rectangle, if fill is not equal to 0 rectangle will be filled with color, color is numeric value.
rect 0, 0, 10, 10, 1, 255*red+120*green+3*blue
- circle x, y, width, height, fill, [color] - draws circle, if fill is not equal to 0 circle will be filled with color, color is numeric value.
- line x1, y1, x2, y2, [color] - draws line.
- poly x1, y1, x2, y2, x3, y3, fill, [color] - x, y, width, height, fill, [color] - draws polygon, if fill is not equal to 0 polygon will be filled with color, color is numeric value.
- gprint x, y, str$, [color] - prints str$ at x, y.\n
gprint 10, 10, s$+"text", 10*red+15*green+13*blue
Arithmetic operators
- (, ), *, /, +, -.
- %len [var] - returns length of [var].
let x=%len "text"
- %asc [var] - returns ASCII code of first character in [var].
let x=%asc "x"
- %rand [var] - return random number from range from 0 to [var].
let x=%rand
let x=%rand 20
- %getkey - returns ASCII code of pressed key.
String operators
- +, ; - connects strings.
- %left$ [var],[num] - returns leftmost [num] characters of [var].
- %right$ [var],[num] - returns rightmost [num] characters of [var].
- %mid$ [var],[start],[num] - returns [num] characters of [var] starting at index [start].
- %chr$ [num] - returns ASCII character whose code is [num].
Special variables
- gwdt - screen width.
- ghgt - screen height.
- red - used when setting color.
- green - used when setting color.
- blue - used when setting color (ex. color=255*red+255*green+255*blue defines white).