System
____________________________

FRE(0|-1|-2|-3)

Returns information about
system memory

 0 - free memory
-1 - largest block of
  integers
-2 - free stack
-3 - largest free block

Unix only:
-10 - total RAM
-11 - used
-12 - free
-13 - shared
-14 - buffers
-15 - cached
____________________________

TICKS() - the system-ticks
  count

TICKSPERSEC() - the number
  of ticks per second
____________________________

TIMER - returns the number
  of seconds from midnight

TIME$ - returns the current
  time as string "HH:MM:SS"

DATE$ - returns the current
  day as string "DD/MM/YYYY"
____________________________

JULIAN(dmy | (d,m,y))

Returns the Julian date.
Valid range from 1/1/100 AD
____________________________

DATEDMY
dmy | julian_date,
BYREF d, BYREF m, BYREF y

Returns the day, month and
the year as integers.
____________________________

WEEKDAY(dmy | (d,m,y) 
             | julian_date)

Returns the day of the week
0 = Sunday
____________________________

DATEFMT(format,
dmy | (d,m,y) | julian_date)

Returns formated date string

Format:
D = one or two digits of Day
DD = 2-digit day
DDD = 3-char day name
DDDD = full day name
M = 1 or 2 digits of month
DD = 2-digit month
DDD = 3-char month name
DDDD = full month name
YY = 2-digit year (2K)
YYYY = 4-digit year

Example:

? DATEFMT("ddd dd, mm/yy",
  "23/11/2001")

REM prints
REM Fri 23, 11/01
____________________________

DELAY ms

Delay for a specified amount
of milliseconds
____________________________

SORT array [USE cmpfunc]

Sorts an array.

The cmpfunc (if its 
specified) it takes 2 vars
to compare. 
It must return
-1 if x < y
+1 if x > y
 0 if x = y

Example:

FUNC qscmp(x,y)
IF x=y 
    qscmp=0
ELIF x>y
    qscmp=1
ELSE
    qscmp=-1
ENDIF
END

DIM A(5)
FOR i=0 TO 5
    A(i)=RND
NEXT
SORT A USE qscmp(x,y)
____________________________

CHAIN file

Transfers the control to
another SB program

Example:
CHAIN "PROG2.BAS"
____________________________

ENVIRON "var=args"
ENVIRON$("var")

Set/return environment 
variable

Note:
Non-PalmOS only
____________________________

RUN file
RUN("command")

Runs an executable.
The RUN() returns a string
with the output of the
command.

PalmOS:
  the 'file' is the creator 
  ID. The RUN() does not
  supported.

____________________________

Debug:
____________________________

TRON/TROFF

TRACE ON/OFF. When trace
mechanism is ON, the SB
displays each line number
as the program is executed
____________________________

LOGPRINT ...

PRINT to SB's logfile
____________________________

BCDUMP [len]

Displays the 'len' next
bytes of byte-code
____________________________

STKDUMP

Displays the SB's internal
executor's stack



