
Extended BASIC Statements V1.1
===============================
ACCEPT [ [AT(row, column)] [VALIDATE (datatype ,...)] [BEEP] [ERASE ALL] [SIZE(numeric-expression)] :] variable	
==> Suspends program execution until data is entered from the keyboard. Options include screen positioning (AT), data validation (VALIDATE), audible tone (BEEP), screen clearing (ERASE ALL), and character limit (SIZE).

CLOSE #file-number [:DELETE]	
==> Stops the program's use of the file referenced by file-number, optionally deleting the file (:DELETE).

DATA data-list	
==> Stores numeric and string constant data in data-list within the program, separated by comma and retrieved sequentially by the READ statement.

DEF function-name [(parameter)] = expression	
==> Defines a user-defined function, associating an expression (numeric or string) with a function-name. Can accept one optional parameter. 

DELETE device-filename	
==> Removes a specified filename from a storage device.

DIM array-name(integer1 [,integer2] ... [,integer7]) [,...]	
==> Reserves space in memory for numeric and string arrays, allowing up to seven dimensions.

DISPLAY [ [AT(row,column)] [BEEP] [ERASE ALL] [SIZE(numeric-expression)] :] variable-list	
==> Transfers variable-list to the display screen. Allows positioning (AT), beeping (BEEP), screen clearing (ERASE ALL), and size control (SIZE).

DISPLAY [option-list:] USING string-expression [:variable-list] OR DISPLAY [option-list: ] USING line-number[: variable-list]	
==> Displays formatted data using string-expression (the format) or line-number (referencing an IMAGE statement).

END	
==> Stops program execution (interchangeable with STOP).

FOR control-variable = initial-value TO limit [STEP increment]	
==> Repeats execution of statements within a loop until the control-variable exceeds the limit. Default increment is one.

GOSUB line-number OR GO SUB line-number	
==> Transfers control to a subroutine starting at line-number.

GOTO line-number OR GO TO line-number	
==> Unconditionally transfers control to a specific line-number.

IF relational-expression THEN line-number1 [ELSE line-number2 ] (or statement variations)	
==> Transfers control or performs statements based on a relational-expression being true or a numeric-expression not being zero. Statements separated by :: may be used instead of line numbers after THEN and ELSE

IMAGE format-string	
==> Specifies the format in which data is printed or displayed when the USING clause is present. Must be the only statement on a line.

INPUT [input-prompt:] variable-list	
==> Suspends execution for keyboard entry, assigning values to variable-list. input-prompt is optional.

INPUT #file-number [,REC record-number ] :variable-list	
==> Reads data from files, optionally specifying record-number for RELATIVE files.

[LET] numeric-variable [, ...] = numeric-expression (and string variation)	
==> Assigns the value of an expression to the specified variable(s). LET keyword is optional and usually omitted.
 
LlNPUT [ [#file-number [, REC record-number]:] string-variable (or keyboard variation)	
==> Assigns an entire line or file record into string-variable without editing commas or quotes.

NEXT control-variable	
==> Paired with FOR-TO-STEP to control loop repetition using the specified control-variable.

ON numeric-expression GOSUB line-number [,...]	
==> Transfers control to the subroutine starting at the line-number corresponding to the value of numeric-expression.

ON numeric-expression GOTO line-number [,...]	
==> Transfers control to the line-number corresponding to the value of numeric-expression.

OPEN #file-number:"device-filename" [,file-organization] [,file-type] [,open-mode] [,record-type]	
==> Prepares the program to use data files, linking file-number to the file and defining its characteristics. File-number: 0-255
; File-organization: RELATIVE or SEQUENTIAL; 
File-type: DISPLAY or INTERNAL; 
Open-mode: INPUT, OUTPUT, UPDATE, APPEND; 
Record-type: FIXED or VARIABLE [Recordlength]

OPTION BASE 1
==> Sets the lowest allowable subscript of arrays to one (default zero)

PRINT [#file-number [,REC record-number] :] [print-list]	
==> Transfers the values in the optional print-list to the display screen (default) or external device/file.

PRINT [#file-number [,REC record-number ] ] USING string-expression:print-list (or line-number variation)	
==> Prints formatted data defined by string-expression or an IMAGE statement referenced by line-number.

RANDOMIZE [numeric-expression]	
==> Resets the random number generator, optionally using numeric-expression for a repeatable sequence.

READ variable-list	
==> Assigns numeric and string constants from DATA statements to the variables in variable-list.

REM character-string	
==> Allows internal program documentation; remarks are not executed.

RESTORE [line-number] 
==> Resets the file pointer for READ/DATA operations 

RESTORE #file-number [, REC record-number]
==> Resets file pointer to the beginning of the file or optionally, to record-number.

RETURN	
==> Transfers program control back from a GOSUB subroutine.

RUN ["device-filename" ][line-number]	
==> Executes a program or loads and runs a specified program from a device.

STOP	
==> Stops program execution.

SUB subprogram-name [(parameter-list)]	
==> Marks the beginning of a user-written subprogram with an optional parameter-list. Parameter are called by reference. Variable in a SUB..SUBEND block are local and persistent between calls. Global variables are not accessable. Arrays are transferred with parenthesis and commas to indicate the dimensions, i.e. a() for one or t$(,) two dimensions.

SUBEND	
==> Marks the end of a subprogram and returns control to the caller.

SUBEXIT	
==> Transfers program control out of a subprogram before SUBEND is reached.



Built-in Functions:
====================
ABS(numeric-expression)	Returns the absolute value of the numeric expression.
ASC(string-expression)	Returns the numeric ASCII code of the first character in the string expression.
ATN(numeric-expression)	Returns the trigonometric arctangent of the numeric expression (in radians).
CHR$(numeric-expression)	Returns the character corresponding to the ASCII numeric expression.
COS(radian-expression)	Returns the trigonometric cosine of the radian expression.
EOF(file-number)	Tests the End-of-File condition of a file.
EXP(numeric-expression)	Returns the exponential value (ex) of the numeric expression.
INT(numeric-expression)	Returns the integer value of the numeric expression.
LEN(string-expression)	Returns the number of characters (length) in the string expression.
LOG(numeric-expression)	Returns the natural logarithm of the numeric expression (must be greater than zero).
MAX(numeric-expression1, numeric-expression2)	Returns the larger of the two numeric expressions.
MIN(numeric-expression1, numeric-expression2)	Returns the smaller of the two numeric expressions.
PI	Returns the value of pi (3.14159265359).
POS(string1, string2, numeric-expression)	Returns the starting position of string2 within string1, beginning the search at numeric-expression.
REC($file-number$)	Returns the current record position in the specified file.
RND	Returns a random number from 0 to 1.
RPT$(string-expression, numeric-expression)	Returns a string equal to numeric-expression repetitions of the original string.
SEG$(string-expression, position, length)	Returns a substring of the string expression, starting at position for length characters.
SGN(numeric-expression)	Returns the sign of the numeric expression: 1 (positive), 0 (zero), or -1 (negative).
SIN(radian-expression)	Returns the trigonometric sine of the radian expression.
SQR(numeric-expression)	Returns the positive square root of the numeric expression.
STR$(numeric-expression)	Returns the string equivalent of the numeric expression.
TAB(numeric-expression)	Specifies the starting column position for the next print item in output statements.
TAN(radian-expression)	Returns the trigonometric tangent of the radian expression.
VAL(string-expression)	Returns the numeric value equivalent to the string expression.




Built-in Subroutines:
======================
CALL CHAR(character-code, pattern-identifier [....] )	Defines special graphics characters (32-143) using a 0 to 64 character hexadecimal pattern-identifier. After 16 hexadecimal characters, the next graphics character is started.
CALL CHARPAT(character-code, string-variable [,...] )	Returns in string-variable the 16-character pattern identifier (hex code) that specifies the pattern of a given character-code.
CALL CHARSET	Restores standard character patterns and colors for characters 32 through 95.
CALL CLEAR	Clears (erases) the entire screen.
CALL COINC( #sprite-number, #sprite-number, tolerance, numeric-variable )  Detects a coincidence between sprites, returning -1 for coincidence and 0 otherwise in numeric-variable.
CALL COINC( #sprite-number, dot-row, dot-column, tolerance, numeric-variable ) Detects a coincidence between a sprite and a location, returning -1 for coincidence and 0 otherwise in numeric-variable.
CALL COINC( ALL, numeric-variable )	Detects a coincidence of any two sprites, returning -1 for coincidence and 0 otherwise in numeric-variable.
CALL COLOR(#sprite-number, foreground-color [,...] ) Sets the color of a sprite
CALL COLOR(character-set, foreground-color, background-color [,...] )	Specifies foreground and background colors for a character-set. A color set is a set of eight characters, the first set with number 1 starts with character 32.
CALL DELSPRITE(#sprite-number [ ,...])	Removes the specified sprite(s) from the screen.
CALL DELSPRITE (ALL)	Removes all sprites from the screen.
CALL DISTANCE( #sprite-number, #sprite-number, numeric-variable)	Returns in numeric-variable the square of the distance between the centers/corners of two sprites.
CALL DISTANCE(#sprite-number, dot-row, dot-column, numeric-variable)	Returns in numeric-variable the square of the distance between a sprite and a screen location.
CALL ERR(numeric-variable1, numeric-variable2, numeric-variable3)	Returns the error-code (numeric-variable1), error-type (numeric-variable2), and line number (numeric-variable3) of the most recent uncleared error.
CALL GCHAR(row, column, numeric-variable)	Returns the ASCII code of the character located at row and column in numeric-variable.
CALL HCHAR(row,column,character-code[,repetition] )	Places the character specified by character-code at row and column, optionally repeating it horizontally repetition times.
CALL INIT	Prepares the computer to run assembly language subprograms.
CALL JOYST( key-unit, x-return, y-return )	Returns values in x-return and y-return based on the position of the joystick 1 or 2 specified in the key-unit. x-return is -4 for left, +4 for right and y-return is -4 for down and +4 for up; 0 is neutral
CALL KEY( key-unit, return-variable, status-variable )	assigns the code of the key pressed on key-unit ( 0 to 5 ) to return-variable Status information is returned in status-variable. 1 means a new key was pressed. -1 means the same key was pressed. 
0 means no key was pressed. Key-Unit 0 returns the ASCII value of the key, 3 the uppercase ASCII value, 1 the left side of the keyboard, 2 the right side of the keyboard. Key-Unit 1 and 2 are also used for the trigger of joystick 1 and 2, returning the key 18. 
CALL LINK(subprogram-name [,argument-list] )	Passes control and optional argument-list to an assembly language subprogram.
CALL LOAD("access-name"[,address, byte1 [,...], file:field, ...] )	Loads an assembly language object file or direct data into the Memory Expansion.
CALL LOCATE(#sprite-number, dot-row, dot-column [,...] )	Changes the location of the given sprite-number to the specified dot-row and dot-column.
CALL MAGNIFY(magnification-factor )	sets the size and magnification of all sprites. Magnification factors: 1=single size unmagnified; 2=single size magnified; 3=double size unmagnified; 4=double size magnified
CALL MOTION(#sprite-number,row-velocity, column-velocity [...])	Changes the motion of sprite-number(s) to the indicated row-velocity and column-velocity.
CALL PATTERN(#sprite-number, character-value [,...] )	Changes the character pattern of the specified sprite-number to character-value (32 to 143).
CALL PEEK(address, numeric-variable-list )	Returns values in numeric-variable-list corresponding to the bytes starting at address.
CALL POSITION(#sprite-number, dot-row, dot-column [,...] )	Returns the current position of the specified sprite-number in the given dot-row(s) and dot-column(s) variables.
CALL SAY(word-string [,direct-string] [,...] )	Causes the computer to speak word-string or the speech code specified by direct-string created by SPGET or external tools.
CALL SCREEN(color-code)	Changes the color of the screen to the specified color-code.
CALL SOUND(duration, frequency, volume [,...] )	Generates sounds, controlling duration (in milliseconds), frequency (tone or noise code), and volume  with 0 the loudest and 30 silence. The frequency must be higher than 109 and the duration must be smaller than 16200. The duration is valid for all channels, the frequency and volume can be set up to three sound generators. A value uf -1 to -8 for the frequency activates the noise generator (only one available).
CALL SPGET(word-string, return-string)	Returns in return-string the speech pattern (code) corresponding to word-string.
CALL SPRITE( #sprite-number, character-value, sprite-color, dot-row, dot column, [,row-velocity, column-velocity] [,...] )	Defines sprites, setting their character, color, position, and optional motion (row/column velocity).
CALL VCHAR(row, column, character-code [,repetition])	Places the character specified by character-code at row and column, optionally repeating it vertically repetition times.
CALL VERSION(numeric-variable)	Returns a value indicating the version of BASIC being used (110 for TI Extended BASIC), placed in numeric-variable.



