Your TS2068’s ROM operating system contains routines to assign input and output to different physical devices without changing the program taking the input and generating the output. This is called device-independent input/output.
When you turn on your 2068, it sets the output according to the following:
Command Outputs to Stream Device LPRINT Printer 3 "P" LLIST Printer 3 "P" COPY Printer 3 "P" PRINT Screen Top 2 "S" LIST Screen Top 2 "S" INPUT Screen Bottom 1 "K"
You can assign any physical device (“K”, “S”, or “P”) to any stream number (0-255). So if you want PRINT to output to the printer instead of the screen, you use:
OPEN #2,"P"
This says to take all the output going to stream 2 and give it to the printer. LIST output will go to the printer too, since it goes to stream 2.
Suppose you want to be able to choose between screen output and printer output every time you RUN the program. You could write your program to output to the screen all the time, and if you have a printer insert OPEN #2,”P”; or you could write for the printer and if you don’t want to use it insert OPEN #3,”S”.
If you want to be neater, you could pick a new stream number (say 4), and write your program with PRINTs where you always want to output to the screen, and LPRINTs where you always want the printer, and PRINT #4 when you want a choice. Then you either OPEN #4,”P” or OPEN #4,”S”. The #4 is just another PRINT modifier, so you end it with a semicolon:
PRINT #4;"Hello",A
One last command, CLOSE #, will help you get things back to normal. CLOSE #1 resets stream 1 to the initial setting (Screen Bottom). CLOSE #2 and #3 do the same. CLOSE #4 (or any other user-defined stream) will just make PRINT # to that stream number invalid.
Warning: some operations ignore the settings of the streams. COPY will always output to the printer, LOAD will always display the file names on the Screen Top. INPUT works only with Screen Bottom.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.