Color BASIC - Functions

Functions

ABS(num) returns the absolute value of num
ASC(str) returns the ASCII code of the first character in str
CHR$(num) returns a single string character with the ASCII code num
EOF(device number) returns 0 if the file has data, or -1 if at the end of the file
INKEY$ returns a character if a key on the keyboard has been pressed, or null if nothing is pressed
INT(num) returns the integer portion of num
INSTR(startpos,search str,target str) searches for the first string, in the target str. startpos is optional.
JOYSTK(num) returns the position of the joystick axis (0-3) with a value from 0 to 63
LEFT$(str,num) returns the first ("left") num characters of string str
LEN(str) returns the length (in characters) of string str
MEM returns the available free memory in bytes
MID$(str,start num,length num) returns a sub-string of string str beginning at position start num and length num characters long. Can also reassign by adding ="newvalue"
PEEK(num) returns the value of the memory location num (0-65535)
POINT(x num,y num) returns the color of the semigraphics dot at position x numm (0-63) and y num (0-31)
RIGHT$(str,position num) returns the end ("right") portion of string str beginning at character position num
RND(number) returns a random number (integer) between 1 and num
SGN(num) returns the sign of a number num, 1 if positive, -1 if negative, 0 if 0
SIN(num) returns the sine of num in radians
STR$(num) returns a string of the number num
USR(num) calls a machine language subroutine whose address is stored in memory locations 275 and 276. num is passed to the routine, and a return value is assigned when the routine is done

Read more about this topic:  Color BASIC

Famous quotes containing the word functions:

    Adolescents, for all their self-involvement, are emerging from the self-centeredness of childhood. Their perception of other people has more depth. They are better equipped at appreciating others’ reasons for action, or the basis of others’ emotions. But this maturity functions in a piecemeal fashion. They show more understanding of their friends, but not of their teachers.
    Terri Apter (20th century)

    Empirical science is apt to cloud the sight, and, by the very knowledge of functions and processes, to bereave the student of the manly contemplation of the whole.
    Ralph Waldo Emerson (1803–1882)

    Let us stop being afraid. Of our own thoughts, our own minds. Of madness, our own or others’. Stop being afraid of the mind itself, its astonishing functions and fandangos, its complications and simplifications, the wonderful operation of its machinery—more wonderful because it is not machinery at all or predictable.
    Kate Millett (b. 1934)