SmallBASIC GuideThe language | Programming Tips | Commands | System | Graphics & Sound | Miscellaneous | File system | Mathematics | 2D Algebra | Strings | Console | Glossary |
Command:
RANDOMIZE
[int]
Seeds the random number generator
Function:
RND
0
Returns a random number from the range 0 to 1
Function:
UBOUND
(array [, dim])
Returns the upper bound of the 'array'
Function:
LBOUND
(array [, dim])
Returns the lower bound of the 'array'
The parameter 'dim' is the array dimension whose bound is returned
DIM v1(-4 TO 7)
DIM v2(1 TO 2, 3 TO 4)
...
PRINT LBOUND(v1) : REM -4
PRINT UBOUND(v1) : REM 7
...
PRINT LBOUND(v2) : REM 1
PRINT LBOUND(v2,2) : REM 3
Function:
CINT
(x)
Converts x to 32b integer
Meaningless. Used for compatibility.
Function:
CREAL
(x)
Convert x to 64b real number.
Meaningless. Used for compatibility.
Function:
CDBL
(x)
Convert x to 64b real number.
Meaningless. Used for compatibility.
Command:
PEN
ON|OFF
Enables/Disables the PEN/MOUSE mechanism.
Function:
PEN
(0..14)
Returns the PEN/MOUSE data.
Values:
- 0
true (non-zero) if there is a new pen or mouse event
- 1
PEN: last pen down x; MOUSE: last mouse button down x
- 2
Same as 1 for y
- 3
true if the PEN is down; MOUSE: mouse left button is pressed
- 4
PEN: last/current x, MOUSE: the current x position only if the left mouse button is pressed (like PEN is down)
- 5
Same as PEN(4) for y
Mouse specific (non PalmOS):
- 10
current mouse x pos
- 11
current mouse y pos
- 12
true if the left mouse button is pressed
- 13
true if the right mouse button is pressed
- 14
true if the middle mouse button is pressed
*, The driver must be enabled before use this function (see Pen command)
Command:
PAUSE
[secs]
Pauses the execution for a specified length of time, or until user hit the keyboard.
Command:
SWAP
a, b
Exchanges the values of two variables. The parameters may be variables of any type.