Classic Computer Magazine Archive COMPUTE! ISSUE 54 / NOVEMBER 1984 / PAGE 10

Instant TI RUNs

Quite awhile ago I read about a command for the TI-99/4A which causes a program to RUN instantly after you hit ENTER. I looked through many books and articles and did not find this information. Can you help?

Dorr Wilson

It sounds like you are describing the pre-scan commands available with Extended BASIC. These commands (!@P—and !@P + ) are documented on pages 7 through 10 in the Addendum of the TI Extended BASIC Manual.

When you enter RUN on the TI, there is a brief pause before the program executes. During this pause (most evident with long programs), the computer "pre-scans" the program and sets aside memory for variables, arrays, and data.

Only certain instructions in a TI BASIC program require pre-scanning. These include the first DATA statement, the first use of each variable and/or array, the first reference to each CALL statement of any subprogram, all DEF statements (for user-defined functions), and all SUB and SUBEND statements (and any variables introduced in the user-defined subprogram). So, rather than pre-scanning an entire program, you can pre-scan only part of it by appropriately positioning the pre-scan commands (!@P + to turn pre-scan on and !@P—to turn it off). in many cases, this greatly reduces the initial pause.

Although you can scatter the pre-scan commands throughout your program where necessary, there is a more efficient way to use this option. Simply collect all the statements you want pre-scanned on one line without regard to syntax and place a GOTO at the beginning of the line. This prevents the other statements on the line from executing during the program run. Here's an example of this technique:

100 DATA 5
110 GOTO 120 ::  I  :: X :: Y :: Z :: CALL CLEAR ::
130 CALL CHAR (97, "FFFF0000FFFF0000")
140 READ X ::  FOR  I = 1 TO X  ::  CALL HCHAR (X + I, 10, 97, X) ::
    CALL  VCHAR (15, X + I, 97, X) ::  NEXT  I
150 READ Y, Z
160 DATA  10, 20
170 DISPLAY AT (20, 5) : Y, Z
180 FOR  I = 1  TO  1000  ::  NEXT  I

For other examples using these commands, consult the Extended BASIC Manual Addendum.