Standard BASIC provides several commonly used algebraic and string functions which may be called from any program without further definition. In the following list, X arid Y stand for any numerical expressions, I and J stand for integers (or expressions whose values are always integers), and X$ and Y$ stand for string expressions.
Function Call Format
Returns absolute value of expression X. ABS(X)=X if X>0, 0 if X is 0 and -X if X<O.
Returns the ASCII number of the first character of the string X$ (you may use a string variable or a string). ASCII numbers are listed in Appendix G.
Returns the arctangent (inverse hyperbolic tangent) of X. The result is in radians in the range -pi/2 to pi/2.
Returns the character with ASCII code I. Either a string of one element or a control function. ASCII codes are in Appendix G.
The cosine function: returns cos(X). X must be in radians.
Returns e to the power X. X must be <=87.3365.
Returns number of bytes in memory not being used by Standard BASIC. If argument is a string, returns number of free bytes in string space. Use this statement to look at it: PRINT FRE(0) or PRINT FRE(X$).
Reads a byte from port I.
Returns the largest integer <=X.
Returns leftmost I characters of string X$.
Returns length of string X$. Non-printing characters and blanks are counted.
Returns natural log of X; X>O.
Without J, returns rightmost characters from X$ beginning with the Ith character. If I>LEN(X$), MID$ returns the null string (that is, one with no characters). 0<I< 255. With 3 arguments, returns a string of length J of characters from X$ beginning with the Ith character. If J is greater than the number of characters in X$ to the right of I, MID$ returns the rest of the string. 0<=J<=255.
Returns a random number between 0 and 1. X<0 always produces one particular number. X>0 gives a new number each time. X=0 gives the last number returned.
Returns the byte, in the range 0 to 255, in location I (decimal), where I<32768.
Returns present column position of terminal's print head. Leftmost position=0.
Returns rightmost I characters of string X$. If I>=LEN(X$), returns X$.
Returns the sign of X. If X>0 returns 1, if X=0 returns 0, if X<0 returns -1.
Returns the sine of the value of X in radians. (COS (X)=SIN(X+pi/2).)
Prints I blanks on the terminal, 0<=I<=255. You must not leave a space between SPC and the parenthesis (or the Sorcerer will think that SPC is a variable, because the reserved word is SPC(.)
Returns square root of X. X must be >=0.
Returns string representation of value of X.
Spaces to position I on the terminal. Space 0 is the leftmost space, 63 the rightmost. If the carriage is already beyond space I, TAB has no effect. (Use SPC to make a relative move.) May only be used in PRINT statements. Just as with SPC, make sure to leave no space between TAB and the parenthesis, or the Sorcerer will think TAB is a variable, because the reserved word is TAB(.
Returns tangent (X). X must be in radians.
Calls the user's machine language subroutine with argument X. See Chapter 12, THE USR FUNCTION.
Returns numerical value of string X$. If first character of X$ is not +, -, or a digit, VAL(X$)=0.
Table of Contents | Prev | Next
The Trailing Edge