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:

    In today’s world parents find themselves at the mercy of a society which imposes pressures and priorities that allow neither time nor place for meaningful activities and relations between children and adults, which downgrade the role of parents and the functions of parenthood, and which prevent the parent from doing things he wants to do as a guide, friend, and companion to his children.
    Urie Bronfenbrenner (b. 1917)

    Mark the babe
    Not long accustomed to this breathing world;
    One that hath barely learned to shape a smile,
    Though yet irrational of soul, to grasp
    With tiny finger—to let fall a tear;
    And, as the heavy cloud of sleep dissolves,
    To stretch his limbs, bemocking, as might seem,
    The outward functions of intelligent man.
    William Wordsworth (1770–1850)

    Nobody is so constituted as to be able to live everywhere and anywhere; and he who has great duties to perform, which lay claim to all his strength, has, in this respect, a very limited choice. The influence of climate upon the bodily functions ... extends so far, that a blunder in the choice of locality and climate is able not only to alienate a man from his actual duty, but also to withhold it from him altogether, so that he never even comes face to face with it.
    Friedrich Nietzsche (1844–1900)