TI-99/4A BASIC Commands and Statements

ABS(numberic-experssion)
Returns absolute value

ASC(string-expression)
Returns the ASCII code of the first character in the string expression.

ATN(radian-expression)
Returns trigonometric Arctangent

BREAK |line-list|
Causes the program to halt. As an option, lines where breaks are desired may be listed.

BYE
Closes open files. Exits TI Basic

CALL CHAR (character-code, pattern-identifier)
Redefines the ASCII character-code using the pattern-identifier, a 16 character HEX coded string.

CHAR table
Character Definition Table

CALL CLEAR
Clears the screen.

CALL COLOR (character-set, foreground-color, background-color)
Changes the foreground and background colors of the character set.

CALL GCHAR (row, column, numeric-variable)
Returns the ASCII code of the character located at specified row (1-24) and column (1-32).

Screen Grid
Screen Grid

CALL JOYST (key-unit, x-return, y-return)
Inputs data based on the x (-4,0,4) and y (-4,0,4) position of the specified key-unit (1-4).

CALL KEY (key-unit, return-variable, status-variable)
Assigns ASCII code of key pressed on specified key-unit (0-5) to return-variable.
Status-Variable Meanings:
1 = new key pressed
-1 = same key pressed
0 = no key pressed

CALL SCREEN (color-code)
Changes screen color to that specified by the color-code.

CALL SOUND (duration, frequency 1, volume 1, |freq2, volume2|, |freq3, volume3|, |freq4, volume4|)
Controls up to three tone and one noise generators. Tone and noise parameters cna occur in any order. Negative duration causes immediate sound update.
duration:
1 thru 4250ms
frequency:
110 thru 44733 Hz
(cycles/sec.) for tone
-1 thru -8 for noise
volume:
0 (loudest) thru 30 (softest)

CALL VCHAR (row, column, character-code |, repetition|)
Places ASCII character at specified row (1-24) and column (1-32) and optionally repeats it vertically.

CHRS$ (numeric-expression)
Returns the string character corresponding to the ASCII code

CLOSE #file-number |:DELETE|
Discontinues association between a file and a program and optionally erases a file.

CONTINUE
CON
Resumes execution after breakpoint has been encountered.

COS (radian-expression)
Returns trigonometric cosine.

DATA data-list
Stores numeric and string constant data in a program.

DEF function-name |(parameter)| = expression
Associates user-defined numeric or string expression with function name.

DELETE file-name or program-name
Removes program or file from computer's filing system.

DIM {array-name (integer1|,integer2|,integer3|}...
Dimensions the listed arrays as specified by integers.

DISPLAY |print-list|

EDIT line number
Displays a line for editing.

END
Terminates program execution.

EOF (numeric-expression)
Returns the end-of-file condition of the specified file.
0 = not end-of-file
1 = logical end-of-file
-1 = physical end-of-file

EXP (numeric-expression)
Returns the exponential value of the argument.

FOR control-variable=initial-value TO limit |STEP increment|
Repeats execution of statements between FOR and NEXT until the control-variable exceeds the limit. STEP default is one.

GOSUB line-number
Transfers control to a subroutine at specified line-number until RETURN encountered.

GOTO line-number
Unconditionally branches to the specified line-number. IF {relational-expression or numeric-expression} THEN line-number1 |ELSE line-number2|
Transfers control to line-number1 if the relational expression is true or the numeric expression is not equal to zero. If false or equal to zero, control passes to the next statement or optionally to line-number2.

INPUT |input-prompt:|variable-list
Suspends program execution until data is entered from the keyboard. The operational input-prompt indicates data to be entered.

INPUT #file-number|,REC record-number|:variable-list
Assigins data from specified file to the listed variables. Records are read sequentially unless an optional REC clause is used.

INT (numeric-expression)
Returns greatest integer less than or equal to the argument.

LEN (string-expression)
Returns the number of characters in the string expression.

[LET] {numeric-variable = numeric expression or string-variable = string-expression}
Assigns the value of an expression to the specified variable.

LIST line-number or line-number1-line-number2 or -line-number or line-number-
Sequentially displays program statements and optionally a single line number or all lines between the specified line numbers.

LOG (numeric-expression)
Returns natural logarighm.

NEW
Clears memory and screen and prepares the computer for a new program.

NEXT control-variable (See FOR statement.)

NUMBER or NUM |initial-line,increment|
Automatically generates sequenced line numbers starting at 100 in increments of 10. Optionally, an initial line and/or increment may be specified.

OLD file-name
Loads a program from a mass storage device into the computer's memory.
Commonly used:
CSX where X is the number of the cassette recorder being used.
DSKX where X is the number of the disk drive being used.

ON numeric-expression GOSUB line-number-list
Transfers control to the subroutine with a beginning line number in the position corresponding to the value of the numeric expression.

ON numeric-expression GOTO line-number-list
Unconditionally branches to line number in the position corresponding to the value of the expression.

OPEN #file-number:file-name |,file-organization|,file-type|,open-model| |,record-type|
Prepares a program to use specified file.
file-number: 0-255
file-organization: SEQUENTIAL or RELATIVE
file-type: DISPLAY or INTERNAL
open-mode: INPUT, OUTPUT, UPDATE, or APPEND
record-type: FIXED or VARIABLE

OPTION BASE {0 or 1}
Sets the lowest allowable subscript of arrays to zero or one. Default is zero.

POS (string1, string2, numeric-expression)
Returns the position of string2 in string1. Search begins at position specified by numeric expression. Returns zero if no match is found.

PRINT {|print-list | #file-number |,REC record-number| or :print-list}
Outputs to the display screen and optionally to an external file or device. The REC clause directs output to the specified record number.

RANDOMIZE |seed|
Resets random number generator to an unpredictable sequence. With optional seed (numeric-expression), the sequence is repeatable.

READ variable-list
Assigns number and string constants in DATA statements to variables listed.

REM
Program documentation. Documentation can be entered after the statement without effecting the program.

RESEQUENCE or RES |initial-line| [,increment]
Renumbers program statements starting at 100 in increments of 10. Optionally an initial line number and/or increment may be specified.

RESTORE { #file-number|, REC record-number | |line-number}
Indicates the record or line from which data will be read. If no options, the beginning of a file or first data statement will be read next.

RETURN
Transfers program control from subroutine to statement following corresponding GOSUB or ON . . . GOSUB statement.

RND
Generates a random number that is between zero (inclusive) and one.

RUN |line-number|
Starts program execution at the lowest numbered statement or optionally at the specified line number.

SAVE file name
Saves a copy of the program that is currently in memory on the specified device. BR>Commonly used:
CSX where X is the number of the cassette recorder being used.
DSKX where X is the number of the disk drive being used.

SEG$ (string-expression, position, length)
Returns a substring of the string-expression that starts at position and is as long as that specified by the length.

SGN (numeric-expression)
Returns 1 if the numeric-expression is positive, 0 if it equals zero, and -1 if the numeric-expression is negative.

SIN (radian-expression)
Returns the trigonometric sine.

SQR (numeric-expression)
Returns the square root.

STOP
Stops program execution.

STR$ (numeric-expression)
Converts the value of the numeric-expression into a string.

TAB (numeric-expression)
Sets the column position of the output of a DISPLAY or PRINT statement.

TAN (radian-expression)
Returns the trigonometric tangent.

TRACE
Lists line numbers of statements before they are executed.

UNBREAK |line-list|
Removes either all breakpoints or those listed.

UNTRACE
Cancels the TRACE command.

VAL(string-expression)
Converts the string-expression into a numeric value.


Color Codes

ValueColor
1Transparent
2Black
3Medium Green
4Light Green
5Dark Blue
6Light Blue
7Dark Red
8Cyan
9Medium Red
10Light Red
11Dark Yellow
12Light Yellow
13Dark Green
14Magenta
15Gray
16White


Home | Site Map | Search | Contact/E-mail | Link To The HCP | FAQ | Newsletter | FREE 99er Web Site | FREE 99er Email | Privacy