## Core Functions

These are the "core" functions, very similar to the other BASIC dialects.

ABS(v|n)

Returns the absolute value of the argument v|n

ACOS(v|n)

Returns the arc cosine value of the argument v|n in radians

ASC(c|t)

Returns the ASCII code for the first letter in the argument c|t

ASIN(v|n)

Returns the arc sine value of the argument v|n in radians

ATAN(v|n)

Returns the arc tangent value of the argument v|n in radians

COS(v|n)

Returns the cosine value of the argument v|n in radians

DEGREE(v|n)

Converts the argument v|n (in radians) to degrees

EXP(v|n)

Returns the exponential value of v|n

FRE(v|n)

Returns the first free address:
in the Code Stack (v|n=0)
in the Number Stack (v|n=1)
or in the Text Stack (v|n=2)

or the last free address:
in the Code Stack(v|n=3)
in the Number Stack (v|n=4)
or in the Text Stack (v|n=5).

Notes:

- The free space is the difference between the two returned addresses for a given Stack. For instance, FRE(0) returns the first free address not used by your program in the Code Stack. You may then POKE [0...65535] values to the Code Stack from this address on up to FRE(3), that is in the [FRE(0)...FRE(3)] range.
- See the MINOSVERSION compiling directive.

INSTRING(c|t1, c|t2, v|n)

Searches for text string c|t2 in c|t1, starting at position v|n in the first text string

Notes:

- this is a caseless search, i.e. "HELLO" and "hello" are the same
- returns the relative position to v|n where text string was first found or 0 if it was not found

INT(v|n)

Returns the largest integer less than or equal to the argument v|n

LEN(c|t)

Returns the length in bytes (number of characters) of c|t

LOG(v|n)

Returns the decimal logarithm of the argument v|n

LN(v|n)

Returns the natural logarithm of the argument v|n

MAX(v|n1, v|n2)

Returns the maximum value of v|n1 and v|n2

MIN(v|n1, v|n2)

Returns the minimum value of v|n1 and v|n2

NOT(v|n)

Returns the negation of the argument v|n

PEEK(v|n)

Returns the [0...65535] value at address v|n in the Code Stack which has to be in the range [1...FRE(3)]

POWER(v|n1, v|n2)

Returns v|n1 raised to power of v|n2

Notes:

- is equivalent to v|n1 ^ v|n2

RADIAN(v|n)

Converts the argument v|n (in degrees) to radians

RND(v|n)

Returns an integer pseudo-random number in the [0...v|n] range

ROUND(v|n)

Returns the nearest integer to the argument v|n

SGN(v|n)

Returns the sign of the argument v|n, 1 for positive numbers, 0 for 0, and -1 for negative numbers

SIN(v|n)

Returns the sine value of the argument v|n in radians

SQRT(v|n)

SQRT returns the square root of the argument v|n

TAN(v|n)

Returns the tangent value of the argument v|n in radians

TICKS

Returns the system ticks

TICKSPERSEC

Returns the number of ticks per second

Notes:

- The ticks per second value depends on the operating system - it is 100 for Palm OS <= 5 devices, if not down- or over-clocked

VAL(c|t)

Returns the numerical value of c|t

BIN$(v|n)

Returns the binary-string value of argument v|n

CHAR$(c|t, v|n)

Returns the v|n th character in text string c|t

CHR$(v|n)

Returns a one-character text string with the character corresponding to the ASCII code indicated by argument v|n

DATE$

Returns the current date based on the computer's internal clock as a string in the form "DD/MM/YYYY"

Notes:

- As implemented under iziBasic, DATE$ cannot be used for assignment (i.e. to set the system date)

HEX$(v|n)

Returns the hexadecimal-string value of argument v|n

LCASE$(c|t)

Returns c|t converted to lower case

LEFT$(c|t, v|n)

Returns the v|n number of leftmost characters of c|t

LTRIM$(c|t)

Returns c|t after having removed leading blank spaces from c|t

MID$(c|t, v|n1, v|n2)

Returns the v|n2 part (length) of the text string c|t starting from position v|n1

OCT$(v|n)

Returns the octal-string value of argument v|n

RIGHT$(c|t, v|n)

Returns the v|n number of rightmost characters of c|t

RTRIM$(c|t)

Returns c|t after having removed trailing blank spaces from c|t

SPACE$(v|n)

Returns a text string of blank spaces v|n bytes (characters) long

STR$(v|n1, v|n2)

Returns a text string giving the representation of the argument v|n1 with the number v|n2 of decimals to return

Note for 2nd argument (v|n2):

- If v|n<0 then return number in exponential notation
- If v|n=0 then return integer part of number

TIME$

Returns the current time based on the computer's internal clock as a string in the form "HH:mm:ss"

Notes:

- As implemented under iziBasic, TIME$ cannot be used for assignment (i.e. to set the system time)

TRIM$(c|t)

Returns c|t after having removed leading and trailing blank spaces from c|t

UCASE$(c|t)

Returns c|t converted to upper case

WORD$(c|t, v|n)

Returns the v|n th word in text string c|t

Notes:

- words are separated by spaces, tabulations or punctuation marks (comma, period, semi-colon, colon, question mark, exclamation mark)