9 Output Operations
NOTE: The statements TAB, SPA, LIN, and PAGE work with DISP and LDISP on the
TAB (charcter position)
The character position is any numeric expression, and is rounded to an integer. If it is less than 1, it defaults to 1. For example:
160 DISP 1;2;3;TAB(10),"BEGINNING OF 10th COLUMN" 1 2 3 BEGINNING OF 10th COLUMNIf the specified column has already been filled, a CRLF is output, and then the TAB is completed. For example, if the line above is changed to:
170 DISP 1,TAB(10),"BEGINNING OF 10th COLUMN" 1 BEGINNING OF 10th COLUMNa CRLF would be output after 1 (notice that the comma causes it to be output in a 20-column field) and the text appears on the next line.
When the character position specified is greater than the number of columns in the standard printer, it is reduced by this formula:
character position MOD N
N being the number of columns specified as the standard printer width. If the character position is a multiple of the printer width, this formula returns a 0. In this case, the item is output in the last column which equals the printer width. For example, with a display width of 80:
180 DISP TAB(10),1;TAB(90),2;TAB(170),3 1 2 3
SPA (number of spaces)
Here is an example:
190 DISP 1;SPA(10);2;SPA(10);3 200 DISP 1,SPA(10),2,SPA(10),3 1 2 3 1 2 3The number of spaces is any positive numeric expression from 0 through 32767, and is rounded to an integer. If it specifies more blanks than remain in the line, the next item begins the next line. For example:
210 Ast$="**********" 220 DISP Ast$;TAB(70);Ast$;SPA(20);Ast$ ********** ********** **********
LIN (number of linefeeds)
The number of linefeeds is any numeric expression, and is rounded to an integer. Its range is from -32768 through 32767.
Here is an example:
230 INPUT "DATE:";Date$ 240 DISP "DATE:";Date$,LIN(5),"END OF PROGRAM",LIN(5) DATE:April 23rd END OF PROGRAMWhen the number of linefeeds is positive, a carriage return is also output. When 0 is specified, only a carriage return is output.
When the number of linefeeds is negative, no carriage return is output and the number of linefeeds output equals the absolute value of the expression. For example:
10 DISP "TODAY";LIN(-2);"IS";LIN(-2);"FRIDAY" TODAY IS FRIDAY
PAGE
Here is an example:
130 Heading: ! print catalog header. 140 PRINT PAGE,Cat$(1) 150 PRINT Cat$(2);LIN(1)When the standard printer is the display, PAGE scrolls the display buffer up to position the cursor at the top of the display.
Here is a short program which uses some of the output function to repeatedly output a string diagonally across the display:
10 DISP PAGE 20 Column=1 30 FOR Line=1 TO 10 40 DISP SPA(Column);"Eloquence" 50 Column=Column+3 60 NEXT Line 70 END Eloquence Eloquence Eloquence Eloquence Eloquence Eloquence Eloquence Eloquence Eloquence Eloquence