RBASIC™ Functions

RBASIC has numerical as well as string functions.

Functions which return string values:

STR$(number)

Returns number converted to text. Example: a$=STR$(5*8) will place "40" into variable a$.

CHR$(ascii value)

Returns character corresponding to the ascii value code.

NL$

Returns new line character (thats ASCII character 13 in decimal).

SPC$(n)

Returns a string of n spaces.

TAB$

Returns the TAB character (that's ASCII character 9).

TIME$

Returns the current time in the format "HH:MM:SS.mss".

DATE$

Returns the current date in the format "YYYY/MM/DD".

SUB$(a$,s,n)

Returns n characters long substring of the string a$, starting at s-th character.

FORMAT$(v,n,d)

Converts numeric value v to a string representation at least n characters long and having d decimal places.

Functions which return a numeric value:

Trigonometrical Functions

SIN(rad)
COS(rad)
TAN(rad)
ARCTAN(value)
ARCSIN(value)
ARCCOS(value)
PI

Arithmetic Functions

SQR(a) - a*a
SQRT (a) - square root of a
ABS(a) - absolute value of a
POW(x,y) - x powered to y
EXP(x) - e powered to x
LOG (x) - decimal logarithm of x
LN(x) - natural logarithm of x

Other Functions

VAL(string$) - converts string to a number
LENGTH(string$) - returns the length of a string$
COMP(string1$,string2$) - compares two strings, returns -1 if string1 is smaller than string2, 0 if strings are equivalent, or 1 if string1 is greater than string2
RND - returns a random value greater than or equal to 0, and less than 1
TRUNC(x) - truncates the value x (discards the digits after decimal point)

For file related functions, please refer to the separate chapter Files, for graphics related functions please refer to Graphics.