Access Key Details
Previous Page || Next Page
Book index page || Jump to TI Basic Glossary

CHAPTER THREE : HOW TO USE TI BASIC
PRACTICAL PROGRAM WRITING
Before you switch your console on to write a program, or even gather a large pile of paper to work on, sit and think about your proposed program.
Work out what your program is to do, and try to split it into small blocks of tasks to be accomplished. Then you can write the coding for each block, and check it to ensure you have made no mistakes, before moving to the next block.
It is much easier to write a small program that works well than to write in one go a 15k program : it is improbable that it will work first time, and you will be faced with a lot of checking!
Some experienced programmers can just sit at their console and input a new program,but certainly at first, you should write your proposed program down on paper. Check the flow of the program before you input it: can any variable or input reach a value which would cause the computer problems? If so, is an 'error trap' required, or does the program need rethinking?
The Basic language is in some ways similar to English: the same task can be accomplished in several ways, but some ways are more efficient than others. A method which works well in one program may be inappropriate in another, therefore it is not possible to give any more than the most general guidelines.
A digital stopwatch can be an advantage when you are trying to find the quickest way of doing something. Usually a single process is too fast to time, but place it in a loop.
(A loop is a part of the program which is repeated several times, until a particular condition is met. In the following FOR ... NEXT loop the condition is met when the variable I reaches a value of 1000).

           FOR I=1 TO 1000
           CALL HCHAR(3,4,45)
           NEXT I  

and it is possible to obtain a reasonably accurate time to compare with other ways of doing the same thing- for instance, to place a single character at one screen position you may also use:
CALL VCHAR(3,4,45) - try substitution in the above loop and see the difference in execution time.

In general the 99/4A is slow at reading DATA and at scrolling the screen (PRINT), but there are occasions when these are the best commands to use.
It is faster for instance to PRINT 24 lines than to use CALL HCHAR 768 times (the number of characters on the screen)!
Your program idea may need to be amended to meet with the demands of the computer, and you should never be afraid of completely scrapping your work and starting again: often new inspiration can lead to a far more efficient program.

Editing and Debugging Before developing some useful routines, a word about editing and debugging : no matter how good a typist you are, even entering a short program will need the use of these facilities.

Editing EDITING is what you do when you change a program line - perhaps only one character in the line.
A number of computers use 'screen editing', where you move the cursor around the screen until it is placed where you want to make your alteration.
The TI99/4A uses a 'line editor' for programs (some modules also use a screen editor,eg TI-WRITER). To use a line editor, you first select the line number you wish to amend, place it on the bottom of the screen, and move the cursor along the LINE until you hit the place to be amended.

To bring the line you want on screen, key in the line number, then hold FCTN down and press key E or X. Your line will appear with the cursor at the beginning of the line.
Use FCTN and keys S and D to move the cursor over the line without deleting or altering anything.
If you wish merely to alter the line, typing over it may be sufficient, but the 99/4A also allows you to delete and insert characters.
To DELETE a character,place the cursor over it (FCTN plus S or D) and then press FCTN and key 1. This will delete the character the cursor is on, and everything following will move one space to the left.

To INSERT text, place the cursor after the last character you wish to leave untouched, using FCTN and S & D, then press FCTN and key 2. Now anything you type will force everything after the insert point one character to the right,and your inserted text will appear. The cursor position also moves to the right as you type. You leave INSERT mode by pressing FCTN and S or D, or pressing ENTER.
When your line is correct, press ENTER to enter the new line into memory, and leave EDIT mode. However, if you wish to amend also the line before or after the line just finished, you may move directly to that by pressing FCTN and E or X.
The maximum line length in TI Basic is four screen lines, but the computer is often capable of taking a longer line, as the absolute restriction is on the length of the line in BYTES of memory used, not the number of characters on the screen.

You may use the edit function to insert 'overlong' lines as follows:
Type in the last part of the required line first. Press ENTER. With the line on screen, press FCTN and key 2, then key in the first part of your line,from the beginning. The part you first entered is pushed to the right.
Now return the line to the screen using the edit mode: type in the line number and then press FCTN and key X.

It is possible to overfill a line this way, and you will receive an error message if you do. However you will usually be able to go to an extra half screen line, and in some cases you may be able to squeeze two extra lines in!

The advantage of putting as much as possible in a line is that by using less program lines you save a little memory. In general, lines with a lot of numbers in will be difficult to expand in this fashion, but lines with a lot of text or commands can usually be considerably extended.
When the line is fully entered,press ENTER. Then LIST the line just to make sure it is all right.

You do not have to INSERT at the beginning of the line, but you may find it easier to do so. Give the computer time to move all the characters to the right when using INSERT. Keep your eyes on the screen.
A brief word of warning: in TI BASIC, your program uses the same area of memory as the values of variables, separated by a 'marker' in memory. As a program runs, the free memory is continually filling. Unwanted values are only purged when the memory is full, resulting in short pauses in program operation.

If the variable area of memory is almost full when you stop to edit a program, inserting extra material MAY result in the permanent loss of the marker which marks the limit of the actual program. This will cause irreversible damage to your program and may prevent the LIST function from operating correctly, or cause a system lockout when you try to run the program.
Therefore try to avoid running the program and then editing it! Before you edit, take a copy of the program to tape - this has the added benefit of apparently clearing the garbage, and not only gives you a security copy but actually prevents the problem occurring!
This problem will not be apparent if you use extended basic plus the 32k ram expansion, as variables then occupy a different sector of memory.


DEBUGGING
Having entered your program, you type in RUN, and instead of the program running, you receive an error message. DEBUGGING is required.
A BUG is quite simply an error in the program, either a mistype or an error in your use of Basic.
The computer does check the lines you enter, but will only spot such things as using only a single bracket ( or quotation mark ".
When you RUN your program, the computer first goes through your program and sets aside memory for each variable and sub program that you have used. During this 'prescan' further errors may be spotted and an error message printed on the screen. Typical errors spotted at this time are incorrect use of arrays (trying to use DIM after the variable has been used) or a mismatched number of FORs and NEXTs.
Most errors will only produce an error message as the computer finds them when your program is actually running - for instance trying to GOTO a non existant line number, or trying to RETURN when there is no outstanding GOSUB.
The error messages generated by the TI99/4A are well described in the manual, and will usually indicate a line number in which the computer has met something it cannot cope with.
Unfortunately, the actual error may not be in the line stated in the error message.
For instance, BAD VALUE IN 100 may refer to:

100 CALL HCHAR(ROW,COL,42)                  

The program line is correct. The error message has appeared because one or both of the variables ROW and COL have a value which is out of range.
(Using CALL HCHAR the ROW and COLUMN values passed to the sub program must be in the ranges 1 to 24 and 1 to 32 respectively. If you go outside this range the computer will halt with an error message.)

To see what the values are, when the error message appears, just type in PRINT ROW;COL then press ENTER.
The two values on screen will be the current values of ROW and COL, which have caused the problem.
The job is then to review the program to see how the variables obtained that value, and see what changes need to be made.

This ability to check variable values after an error message is very valuable. Note that once you amend a program line all variables will be reset to zero.

Frequent causes of problem bugs are DATA statements, with a comma too many or too few.The ability to check variable values is useful here:
An array is being filled from a DATA statement, eg
 FOR I=1 TO 5
 READ A
 VAR(I)=A
 NEXT I
 DATA 23,54,8,A,5 


An error message will be generated by the above, as 'A' is not a number. When the error message appears it is possible to enter:
PRINT I;VAR(I)
This will provide the clues needed to lead to the erroneous DATA line - which may be several hundred program lines away!

In such cases you need to have a good idea of what values should be found in connection with each variable, and you may need to spend some time working through the program.

If you cannot fathom why a program is not working as it should merely by reading the LIST, the TI99/4A also has a TRACE option.
Key in TRACE and then RUN. The line numbers will be listed on screen as the program progresses, and you can watch for an unexpected line transfer as the computer moves from one line to the next. Using TRACE will disrupt any screen display. Switch TRACE off by keying in UNTRACE.

To find out what the variable values are at a particular point in the program, you can insert PRINT statements in the program, or instruct the program to BREAK by adding a line in the appropriate place with the instruction: BREAK.
Then when the program stops you may enter PRINT VAR etc. To continue the program enter CON (and press ENTER) Remember to remove the BREAK line when you no longer need it.

As your programs become longer, so it becomes more difficult to spot the errors, but finding and removing errors is a very good (if time consuming) way of learning how to use your TI99/4A. With time and experience you will learn to quickly spot the easy bugs and to tackle the harder ones in a logical fashion. Read your manual as often as necessary,especially the section on ERROR MESSAGES.Often the answer to a difficult bug is there just waiting for you to read it.

System Lock Outs
A lock out has occurred if your console no longer responds to the keyboard (especially QUIT) and ceases to function normally. Unusual sound and graphic effects may occur.
It is quite normal for all computers (and word processors) to lock out from time to time. The cause is an error in the instructions passed to the processor, which it cannot deal with. There are a number of causes:
A STATIC discharge is a frequent cause of problems. Although computers no longer need the carefully controlled environment of the mainframe, they remain sensitive to static. The problem is most acute in warm dry weather, or if you wear clothing made of artificial fibres (acrylics are particularly bad). Nylon carpeting can also be a problem. The TI99/4A can handle static quite well, but on occasion you may meet the problem.
Use of cotton clothing, a humidifier, and an anti static spray on the carpet may be called for in especially hostile environments. A conductive carpet is also sold by some computer suppliers.
Poor communication with modules or peripherals may also be a problem: the contacts are essentially self cleaning, but it may be necessary to disconnect/connect a few times to make good contact. Contacts are silver plated and are subject to tarnishing, and may require this treatment if a module or peripheral is not used for some time. Tar can be deposited on the contacts if there are smokers in the room. In extremely severe cases of pollution, an isopropyl alcohol solvent may be used but great care is required to prevent damage.
Some modules contain insufficient error traps and permit you to pass confusing instructions to the processor. Extended Basic in particular allows a number of lock out producing errors. If your syntax is correct,this will not happen.
Loss of the stack/program marker can cause problems in TI BASIC. This occurs when you run a program (filling the stack) and then add to the program. In some cases the computer will add the stack to the program with sometimes colourful results, but permanently destroying the program (if a lock out does not occur).After running a program, it is wise to save it before editing: this appears to clear the stack.
When the computer ceases to function,and possibly makes a piercing sound, do not panic! The only way out of a lock out is to switch off and (after a few seconds) restart. Even the MOST expensive systems sometimes lock out.


Just as with English, your ability to use BASIC increases with use. Examine as many 99/4A programs as you can and look to see
i)WHAT each part of the program does
ii)HOW it does it and
iii)WHY it does it.

Then try to improve the program!

Using Colour (or COLOR) First the listing then a description of the program.

This simple graphics demonstration program uses several of the features of TI BASIC described in the preceding article.
The descriptive text which follows will help you to follow the program.
To enter this program, select TI BASIC, then ENTER the word NUM. This will automatically provide the line numbers and you will only have to type in the remainder of the lines.

100 REM DEMO OF COLOUR
110 REM IN TI BASIC
120 REM
130 RANDOMIZE
140 PRINT " "::::"ONE MOMENT
..."::::::
150 DIM F(100)
160 DEF RAN(A)=INT(A*RND)+1
170 M$="0"
180 FOR CHARR=32 TO 152 STEP
8
190 CALL CHAR(CHARR,M$)
200 NEXT CHARR
210 FOR SET=1 TO 16
220 CALL COLOR(SET,16,SET)
230 CALL VCHAR(1,2*SET-1,24+
SET*8,48)
240 NEXT SET
250 FOR SET=1 TO 9
260 CALL HCHAR(22,2*SET,48+S
ET)
270 NEXT SET
280 CALL HCHAR(22,20,48)
290 FOR SET=11 TO 16
300 CALL HCHAR(22,2*SET,38+S
ET)
310 NEXT SET
320 FOR SET=10 TO 16
330 CALL HCHAR(22,2*SET-1,49)
340 NEXT SET
350 FOR X=1 TO 1000
360 NEXT X
370 FOR SET=3 TO 14
380 CALL HCHAR(2*SET-5,1,24+
SET*8,32)
390 NEXT SET
400 FOR X=1 TO 4000
410 NEXT X
420 INPUT " ENTER TO CONTINU
E":A$
430 CALL CLEAR
440 CALL SCREEN(12)
450 FOR X=1 TO 150
460 R=RAN(24)
470 VR=RAN(32)
480 SET=RAN(16)
490 CALL HCHAR(R,VR,24+SET*8)
500 NEXT X
510 FOR X=1 TO 50
520 R=RAN(24)
530 VR=RAN(32)
540 SET=24+8*RAN(16)
550 NO=RAN(32-VR)
560 CALL HCHAR(R,VR,SET,NO)
570 CALL HCHAR(25-R,33-VR,24
+8*RAN(14),NO)
580 CALL VCHAR(1+VR/2,R/1.5+
1,SET,3/4*NO)
590 NEXT X
600 FOR COUNT=32 TO 152 STEP
8
610 CALL CHAR(COUNT,"88CCEEF
F88CCEEFF")
620 CALL CHAR(COUNT+1,"80C0E
0F0F8FCFEFF")
630 CALL CHAR(COUNT+2,"7F3F1
F0F070301")
640 CALL CHAR(COUNT+3,"FF3C1
81818183CFF")
650 CALL CHAR(COUNT+4,"00C3E
7E7E7E7C3")
660 CALL CHAR(COUNT+5,"FFFEF
CF8F0E0C080")
670 CALL CHAR(COUNT+6,"00010
3070F1F3F7F")
680 CALL CHAR(COUNT+7,"183C7
EFFFF7E3C18")
690 NEXT COUNT
700 FOR COUNT=1 TO 100
710 CALL HCHAR(RAN(24),RAN(3
1),RAN(129)+31)
720 NEXT COUNT
730 X=110
740 K=2^(1/50)
750 FOR COUNT=1 TO 100
760 F(COUNT)=X*K^COUNT
770 NEXT COUNT
780 FOR COUNT=1 TO 100
790 CALL SOUND(100,F(RAN(100 )),1)
800 CALL COLOR(RAN(16),RAN(1 6),RAN(16))
810 IF RAN(10)>3 THEN 830
820 CALL SCREEN(RAN(16))
830 NEXT COUNT
840 FOR Z=1 TO 5
850 FOR COUNT=3 TO 30
860 CALL VCHAR(8,COUNT,RAN(1
29)+31,2)
870 CALL VCHAR(5,COUNT,RAN(1
29)+31,2)
880 CALL SOUND(-100,F(RAN(10
0)),1)
890 NEXT COUNT
900 FOR COUNT=30 TO 3 STEP -1
910 CALL COLOR(RAN(16),RAN(1
6),RAN(16))
920 CALL VCHAR(12,COUNT,RAN(
127)+32,2)
930 CALL VCHAR(15,COUNT,RAN(
127)+32,2)
940 CALL SOUND(-110,F(RAN(10
0)),1)
950 NEXT COUNT
960 NEXT Z
970 FOR Z=1 TO 26
980 FOR X=1 TO 28
990 M$=CHR$(RAN(127)+32)&M$
1000 NEXT X
1010 PRINT M$
1020 M$=""
1030 CALL SOUND(-400,F(RAN(1
00)),1)
1040 NEXT Z
1050 FOR X=1 TO 100
1060 CALL COLOR(RAN(16),RAN(
16),RAN(16))
1070 NEXT X
1080 M$="1234567809ABCDEF"
1090 X=0
1100 FOR Z=1 TO 8
1110 FOR CT2=1 TO 16
1120 P$=P$&SEG$(M$,RAN(1
6),1)
1130 CALL SOUND(-100,RAN(200
)+110,RAN(10))
1140 NEXT CT2
1150 FOR CT=1 TO 8
1160 CALL CHAR(8*CT+24+X,P$)
1170 NEXT CT
1180 X=X+1
1190 P$=""
1200 NEXT Z
1220 CALL SCREEN(RAN(16))
1230 FOR X=1 TO 100
1240 CALL HCHAR(RAN(24),RAN(
32),RAN(127)+32)
1250 CALL SOUND(-50,F(RAN(10
0)),RAN(20))
1260 CALL COLOR(RAN(16),RAN(
16),RAN(16))
1270 NEXT X
1280 CALL SCREEN(RAN(16))
1290 FOR X=1 TO 100
1300 CALL COLOR(RAN(16),RAN(
16),RAN(16))
1310 CALL SOUND(-20,110+20*R
AN(40),3)
1320 NEXT X
1330 CALL SCREEN(RAN(16))
1340 M$=""
1350 FOR Z=1 TO 26
1360 FOR CT=1 TO 28
1370 M$=CHR$(RAN(127)+32)&M$
1380 NEXT CT
1390 PRINT M$
1400 M$=""
1410 CALL SCREEN(RAN(16))
1420 CALL COLOR(RAN(16),RAN(
16),RAN(16))
1430 NEXT Z
1440 FOR CT2=1 TO 100
1450 CALL COLOR(RAN(16),RAN(
16),RAN(16))
1460 NEXT CT2
1470 CALL SCREEN(RAN(16))
1480 STOP

The use of brackets after RAN in line 160:
DEF RAN(X)=...
does NOT indicate that RAN is a variable array. They inform the computer that when the newly created FUNCtion RAN is used in a program, a variable will be passed to the definition by means of the brackets.

e.g. 460 R=RAN(24)

The computer replaces RAN(24) with the defined statement using the value 24 in place of X.

The use of brackets does not always imply an array!

Explanation of the Colour Demonstation program:
This program has been provided to give a practical demonstration of some of the features of TI BASIC described earlier.

The program has been written in small blocks, and each block will be described separately.

The first section, lines 100 to 420 form the start of the program. The first block is intended to display the colours available, and by making them cross over each other, show the relative contrasts.
Because some random patterns are created later, RANDOMIZE has been used to provide different patterns each time the program is run. The array F contains frequency values for use with CALL SOUND later on. As it will contain 100 values, DIM is used to instruct the computer to allocate memory to hold the values.
The DEF function is used to create a new random function, which will provide integer (eg no fraction) numbers from 1 to the figure used with the new function in the program: watch out for the new function RAN(X) in the program.
M$ has been set to "0" (a string with a zero in it) for use in defining all the characters as blanks (eg spaces) in the following loop in lines 180 to 200. The string "0" could have been placed in the definition function in line 190, instead of the string variable.
NB: Although the TI99/4A distinguishes the number 0 from the letter O on screen by squaring the O, in listings a slashed 0 usually represents the number.

Each group of eight characters is in a separate character set, and each set may be a different colour. Lines 210 to 240 change the colour of each set: TI Basic has 16 sets, and 16 colours. The foreground colour of every set has been set to WHITE( code 16).
Line 230 places a number of vertical stripes on the screen, each a different colour. As the screen is 32 columns wide, the stripes have been set to 2 columns wide each, and therefore each CALL VCHAR uses 48 characters (2x the 24 rows).
So that we know which colours are which, they are labelled by the routine in lines 250 to 340.
Lines 350-360 give a small delay.

It is not possible to provide 16 horizontal bands with a space between each, as the screen only has 24 rows, but lines 370 to 390 cross the screen with as many rows as can fit.

In lines 430 to 500, random characters are placed on a blank screen, and in lines 510 to 590, random stripes and columns are placed on screen.
Lines 600 to 690 redefine the characters for the purposes of the following sections of the program. Remember that the strings used with CALL CHAR can only contain the numbers 0 to 9 and the letters A to F.
700 to 720 again place random characters on screen.
Lines 730 to 770 fill the F array with values to be used with subsequent CALL SOUNDs. Line 730 sets the lowest possible frequency, and line 740 sets the basis for the tones: the formula used creates what is known as 'microtonal' music, with very little difference between adjacent tones.
Then, accompanied with random tones, the character colours are varied at random in lines 780 to 830.

Lines 840 to 960 provide sound, colour changes, and small bars of random characters.
Lines 970 to 1040 use the PRINT routine to place random characters on screen, and the colour is varied in 1050 to 1070.
In lines 1080 to 1200, characters are given a random definition and in 1220 to 1260, the colours are varied, random chracters placed and tones generated.
1270 to 1310 again varies the colours, and uses a different random tone generation method (line 1300).
The remainder of the program again uses PRINT to provide a random display and the colours are varied.

Note in particular the usefulness of the DEF statement in this program.
There are many 'loops', and some loops contain other loops : see for example lines 840 to 960. These loops are 'nested', with the COUNT loop inside the Z loop.

An ARRAY is used to store frequencies.

The loop counters (eg CHARR, SET and so on) also function as numeric variables in the loops. Their value increases by one for each cycle of the loop until the maximum value (set by the TO X in FOR TO NEXT ) has been reached.

In line 1120, SEG$ is used with the string variable M$ (set in 1080) to create a random definition of a character. A letter is chosen at random from the string variable M$, and used to create the definition in the variable P$.
Note that P$ is reset to a 'nul' (empty) string after each character has been defined. Then it is reused with different letters to form a new definition.


TI BASIC GLOSSARY
A list of all the commands and functions available in TI BASIC, with brief descriptions.

ABS(X)
Used to obtain an ABSolute value - eg it ignores the + or - sign.
APPEND
Used to extend files when using the disk system or mini memory module.
ATN(X)
Provides the arctangent : this is a trigonometrical function. ATN(X) provides the angle in radians whose tangent is X.
BREAK
Used in a program to temporarily halt execution. A message is placed on screen. The program is continued by typing in CONTINUE
BYE
Used to return to the master screen. Preferable to the use of the QUIT key, as only BYE will properly close any open files, and ensure no data is lost.

CALL CHAR(N,STRING$)
Used to define character N by means of a hexadecimal string STRING$.
CALL CLEAR
Used to clear the screen.
CALL COLOR(SET,FG,BG)
Used to defing the foreground (FG) and background (BG) colours of each of 16 sets of characters. Sixteen colours, including transparent are available.
CALL GCHAR(ROW,COL,CH)
Places in the variable CH the ASCII code of the character on the screen in ROW, COLumn.
CALL HCHAR(ROW,COL,CH,NO)
Used to display a character CH in ROW, COLumn. When a number or variable in the position NO is used, the character is repeated horizontally NO times.
CALL JOYST(NO,X,Y)
Returns X and Y values for Joystick NO.
CALL KEY(NO,CODE,STATUS)
Interrogates the keyboard. If a key is depressed the ASCII code is placed in variable CODE. STATUS indicates if a key is pressed, and if it is the same key when two adjacent CALL KEYs detect a key pressed. NO indicates the key unit, and is used to split the keyboard and to switch the codes returned by the Function and Control keys.
CALL SCREEN(NUMB)
Used to change the colour of the screen.
CALL SOUND(TIME,F1,V1,F2,V2,F3,V3,N,V4)
Used to generate sound. Up to three tones may be used with an optional noise channel. TIME is in milliseconds and F1,F2 and F3 are the frequencies in cycles per second.
CALL VCHAR(ROW,COL,CH,NO)
As CALL HCHAR, but the character CH is repeated vertically NO times.

CHR$(CODE)
Used to make a character CODE available as a string.
CLOSE
Used to close a data file.
CONTINUE
Used to resume a program when execution has been halted with the CLEAR key or a BREAK command.
COS(X)
Provides the cosine of angle X, where X is in radians.

DATA
Used as a heading on lines containing values to be READ.
DEF
Used to DEFine a function of your own.
DELETE
Used with the disk system to DELETE a file.
DIM
Used to DIMension an Array.
DISPLAY
i. Same effect as PRINT
ii.One of two file storage formats. DISPLAY uses the same codes and format as the computer uses for screen displays.
EDIT
One method of entering EDIT mode.
END An optional marker for the end of your program.
EOF
'End Of File' used with disk files.
EXP(NO)
The inverse of the natural logarithm function LOG. Thus X=EXP(LOG(X))

FIXED
Used to define data files. The alternative, not available with cassettes, is VARIABLE.
FOR...TO..(STEP)
Used to establish loops which execute until the> counter reaches the value following TO.
GOSUB
Used for a line transfer when the program is to RETURN to the line following the GOSUB line after the section transferred to is completed.
GOTO
Used to make a simple line transfer.
IF...THEN...ELSE
Used to make conditional line transfers, with an optional alternative transfer if ELSE is used.
INPUT
i. Used to fill a variable from the keyboard,or other device if a data file is used.
ii.Used to specify a file is to be used for INPUT only.
INT(NO)
Used to provide the INTeger of a number NO. eg any fraction is removed.
INTERNAL
Used to specify the format of a data file. INTERNAL specifies the codes used by the processor internally. The alternative is DISPLAY.

LEN(STRING$)
Used to provide the LENgth of the string STRING$.
LET
Optional. LET A=2 and A=2 are both accepted.
LIST
Lists a program on screen or other device.
LOG(NO)
Provides the natural logarithm of number NO.
NEW
Used to clear the console memory in preparation for a new program.
NUM / NUMBER
Provides line numbers automatically when a program is to be keyed in. Starting number and increment may be defined. Default is to start at 100 and increase each line number by 10.

OLD
Used to load a program from cassette or other storage device.
ON...GOSUB
Used for GOSUB transfers when the value following ON determines which of the line numbers following GOSUB are to be used.
ON...GOTO
Similar to the above, but for simple line transfers when it is not wished to RETURN to the line following the transfer.
OPEN
Used to OPEN a file to a device.The format of the file is specified after the OPENcommand.
OPTION BASE
Used to set the minimum value of an array to zero or one.
OUTPUT
Used to specify a data file is to be used for output only.
POS(STRING$,X$,NO)
Used to obtain the first occurrence in STRING$ of X$.
PRINT
i. Used to display characters on the screen and to scroll the screen upwards.
ii. Used to send data to an external storage device when used with files.

RND
Used to obtain a RaNDom number. The same sequence of numbers is generated every time a program is RUN.
RANDOMIZE
Used to set the initial number used by RND to be different each time a program is RUN.
READ
Used to place the values in DATA statements into variables.
REC
Used with the disk system to specify a specific RECord in the file.
RELATIVE
Used with the disk system for random access to data on a file by using RECord numbers.
REM
Used to add REMarks to programs.
RES / RESEQUENCE
Used to resequence a program, that is, change the line numbers. Default is to start the program at line 100 and use increments of 10, but start number and increment may be specified.
RESTORE
Used to reset the DATA pointer, either to the first data item, or to data on a particular line.
RETURN
Any line transfer by GOSUB must be terminated with RETURN. The program then transfers to the line following the GOSUB.
RUN
Instructs the computer to RUN the program in its memory.

SAVE
Used to SAVE a PROGRAM to a storage device.
SEQUENTIAL
Used to specify that file data is recorded in the order it is output. The alternative is RELATIVE, which is not available with cassette files.
SGN(NO)
Used to obtain the SiGN of the number NO. Indicates if NO is zero,negative or positive.
SIN(X)
Provides the SINe of the angle X where X is in radians.
SQR(X)
Provides the SQuare Root of the number X.
STOP
Used to STOP program execution. A STOPped program may only be resumed by re-RUNning it.
STR$(NO)
Used to change a number or numeric variable into a string. The converse is VAL.

TAB
Used when PRINTing to print at from a specified column.
TAN(X)
Provides the TANgent of angle X where X is in radians.
TRACE
Causes the computer to list on screen the number of each line as a program is executed. Switched off with UNTRACE.

UNBREAK
Used in command mode to remove BREAK commands which have been placed in command mode.
UNTRACE
Switches TRACE off.
UPDATE
Used with disk file processing to enable a file to be read or written to.
VAL
Used to obtain the numeric equivalent to a string. The string must be composed only of valid numbers.
VARIABLE
Used with disk files to indicate the file is to be as long as the item to be stored, which may vary.


THE INFORMATION IN THIS BOOK IS FREE. It may be copied, distributed and/or modified under the conditions set down in the Design Science License published by Michael Stutz at http://dsl.org/copyleft/dsl.txt

Book index page |

Access Key Details
Stephen's Entry Page | TI99/4a |Linux |Search | History St Thomas Church Heaton Chapel | Entertainment | Music Links

Light Reference | Educational Reference | Science Fiction | Travel | News Links | Anime




Note 1: AddFreeStats will try to set a cookie when this page is loaded. The cookie relates to "*.addfreestats.com/" only and records that your IP address looked at this page, for purposes of tracking re-visits. . The cookie can be safely refused without imparing your web enjoyment. At present I cannot locate a relevant privacy policy on their site. How to manage and delete cookies
Note 2: If you click this link to AddFreeStats you will need to have javascript enabled to use their website. Otherwise you will see a blank page! Again, their foolishness will not interfere with your enjoyment of THIS web site!