>> 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()

Returns the system-ticks. The tick value is depended on operating
system.
____________________________

TICKSPERSEC()

Returns 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.
(dates must be greater than 1/1/100 AD)

Example:

PRINT Julian(DATE)
PRINT Julian(31, 12, 2001)
____________________________

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)

Example:

PRINT WeekDay(DATE)
PRINT WeekDay(Julian(31, 12, 2001))
PRINT WeekDay(31, 12, 2001)
____________________________

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
MM = 2-digit month
MMM = 3-char month name
MMMM = full month name
YY = 2-digit year (2K)
YYYY = 4-digit year

Example:

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

REM prints "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.
cmpfunc must returns
-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)
____________________________

SEARCH A, key, BYREF ridx [USE cmpfunc]

Scans an array for the key.
If key is not found the SEARCH command returns (in ridx) the value
(LBOUND(A)-1). In default-base arrays that means -1.

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

Example:

FUNC cmp(x,y)
cmp=!(x=y)
END

DIM A(5)
FOR i=0 TO 5
A(i)=5-i
NEXT
SEARCH A, 4, r USE cmp(x,y)
PRINT r:REM prints 1
PRINT A(r): REM prints 4
____________________________

CHAIN file

Transfers control to another BASIC program.

file - A string expression that follows OS file naming conventions;

Example:

CHAIN "PROG2.BAS"
____________________________

ENVIRON "expr"
or
ENV "expr"

Adds a variable to or deletes a variable from the current environment
variable-table.

expr - A string expression of the form "name=parameter"

If name already exists in the environment table, its current setting is
replaced with the new setting. If name does not exist, the new variable
is added.
____________________________

ENVIRON("var")
or
ENV("var")

Returns the value of a specified entry in the current environment
table.

var - A string expression of the form "var"
____________________________

RUN cmdstr

Loads a secondary copy of system's shell and, executes an program, or
an shell command.

cmdstr - Shell's specific command string

After the specified shell command or program terminates, control is
returned to the line following the RUN command.

Notes:
* PalmOS: The 'cmdstr' is the Creator-ID
* PalmOS: The RUN never returns
____________________________

RUN("command")

RUN() is the function version of the RUN command. The differnce is
that, the RUN() returns a string with the output of the 'command' as
an array of strings (each text-line is one element).

Notes:
* PalmOS: The RUN() does not supported.
* Windows: The stdout and stderr are separated! First is the
stdout output and following the stderr.
____________________________

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. The syntax is the same with the PRINT command.
____________________________

STKDUMP

Displays the SB's internal executor's stack

____________________________

