Contents / Reference section / BASIC keywords / Previous letter / Next letter / Index
TAB can only be used with the keywords PRINT and INPUT. There are two versions:
TAB(X) will print spaces up to a certain column position. If the flashing cursor is beyond the required position then the cursor will move to the next line down and space across the required column.
TAB(X,Y) will move the cursor directly to position X, Y on the screen. Note that once TAB(X,Y) has been used on a line, TAB(X) may not move to the correct position on the line.
The origin (for all text commands) is at the top left of the current text area of the screen.
The left hand column of the screen is column number 0. The right hand is column 19, 39, or 79 depending on the graphics mode selected.
The top line is line number 0, the bottom line is line number 31 or 24.
If the text scrolling area of the screen is changed then the TAB command will still work as outlined above.
340 PRINT TAB(10);name$TAB(30);job$
440 PRINT TAB(20,31);value
230 INPUT TAB(10,20) "How much" cost
875 INPUT TAB(30), "Doctors name", DOC$
TAB with a single argument prints spaces (and a newline if necessary) to reach the specified column.
TAB with two arguments moves the cursor directly to the specified co-ordinates.
PRINT TAB(<numeric>[,<numeric>])
or
INPUT TAB(<numeric>[,<numeric>])
POS, VPOS, PRINT, INPUT
This mathematical function calculates the tangent of the angle given.
The angle must be given in radians but may be converted to radians from degrees using the function RAD. 1 radian is about 57 degrees.
PRINT TAN(RAD(45))
10 Y=TAN (X)
1030 droop=TAN(load)
A function returning the tangent of the argument. The argument must be given in radians.
<num-var>=TAN<numeric>
COS, SIN, ACS, ATN, DEG, RAD
A keyword used with IF to decide on a course of action as the result of some test.
780 IFX=6 THEN PRINT "good" ELSE PRINT "bad"
200 IF A$=B$ THEN PROCgood ELSE PROCbad
Optional part of the IF...THEN...ELSE structure.
Note that it is not optional if used when the condition assigns to a pseudo variable, eg
300 IF X THEN TIME=0
IF <testable condition>THEN<statement>[ELSE<statement>]
IF, ELSE
This can be used to set or read the internal timer.
The timer counts in one hundredth of a second intervals. It is not a clock providing true time-of-day readout. You can't use it to check the Greenwich Time Signal! However once set, the internal clock will keep good time. Pressing the BREAK key does not reset the clock.
To convert TIME to a 24 hour clock use the following routines:
1000 SEC=(TIME DIV 100)MOD 60
1010 MIN=(TIME DIV 6000)MOD 60
1020 HR =(TIME DIV 360000)MOD 24
205 TIME=((Ho*60+Mi)*60+Se)*100
400 nowtime=TIME
A pseudo-variable which sets or reads the lower four bytes of the internal elapsed time clock.
TIME=<numeric>
or
<num-var>=TIME
1070 finishtime=TIME+1000
1080 REPEAT
1090 REM wait for 10 seconds
1100 UNTIL TIME>=finishtime
Part of the FOR...TO...STEP...NEXT statement. The final terminating value of the loop is given after the word TO. See page 91 for further information.
Part of the FOR...NEXT construct.
FOR<num-var>=<numeric>TO<numeric> [STEP <numeric>]
FOR, STEP, NEXT
10 MODE 5
20 FOR C=l TO 3
30 GCOL 3,C
40 FOR X=0 TO 1200 STEP 5*C
50 MOVE 600,1000
60 DRAW X,0
70 NEXT X
80 NEXT C
The function TOP returns the address of the first free memory location after the user's program. The user's program is normally stored from the bottom of the available Random Access Memory upwards.
Thus the length of the user's program in bytes is given by
TOP-PAGE.
PRINT~(TOP-PAGE):REM length in hex
2340 PRINT TOP
5460 X=TOP
A function returning the first free location above the user's program.
<num-var>=TOP
PAGE, HIMEM, LOMEM
TRACE makes the computer print out the line number of each line of the program before execution.
There are three forms of TRACE:
TRACE ON causes the computer to print line numbers
TRACE OFF turns off the trace facility
TRACE 6780 would cause the computer to report only line numbers below 6780.
With well-structured programs which have subroutines at high line numbers this will enable the user to trace through the structure of the program without being bothered with line numbers in procedures, functions and subroutines.
Note that the interpreter does not execute line numbers very often
10 FOR Z=0 TO 100
20 Q=Q*Z: NEXT Z
30 END
would print [10] [20] [30] but
10 FOR Z=0 TO 100
20 Q=Q*Z
25 NEXT Z
30 END
would print [10] [20] [25] [25] [25] [25] [25]
(Of course in MODE 7 the [ appears as ← and ] appears as →.)
TRACE is also turned off after an error, or by pressing ESCAPE or BREAK.
TRACE ON
TRACE OFF
TRACE X
TRACE 3000
TRACE ON causes the interpreter to print executed line numbers when it encounters them.
TRACE X sets a limit on the size of line numbers which may be printed out; only numbers less than X will be printed.
TRACE OFF turns trace mode off.
TRACE ON|OFF|<numeric>
TRUE is represented by the value -1 in this computer.
PRINT TRUE
300 UNTIL result = TRUE
A function returning -1.
<num-var>=TRUE
FALSE