PRINT or LPRINT

Authors

James Brezina

Publication

Publication Details

Volume: 1 Issue: 4

Date

May 1987

Pages

8-10
See all articles from Nite-Times News v1 n4

Each new book ะ† have bought on the TS 2068 has taught me quite a bit about programming on the computer. The things I have learned lately on the keyword PRINT are quite interesting. The latest book I purchased, “Introduction to 2068 Machine Languageโ€ by Dr. Lloyd Dreger, explained quite a bit about it.

Many times I have entered programs with the command “PRINT#0;” or the command “PRINT #1;”. I found that the command would cause whatever followed it (a string or numbers) to be printed to the bottom two lines on the screen. However, in order for that information to remain on the screen, one has to provide some means to prevent an error statement or INPUT from appearing there. That ัะฐะฟ be done by a PAUSE or by following it with along FOR – NEXT loop. All the PRINT # commands are to be followed by a semi-colon.

Dr. Dreger’s book informs me that “PRINT #2;” will print to the upper screen which is the same thing that PRINT also does. The next PRINT command “PRINT #3;” will send the printing to the printer. This will be either the 2040 printer or a full size printer as long as you have the printer driver loaded and initialized.

Is there a PRINT #4;? Yes, I have found it used by the “ZTALKERโ€. It is the means by which words are entered to make the “ZTALKER” talk. However, some words do not sound right if spelled normally, so you might have to misspell them to get theโ€ ZTALKERโ€ to sound right.

I have not seen anything about using anything above #4 in these PRINT statements in the above manner. I have seen the mused in another manner which I will explain later on.

An interesting thing about this PRINT #3 setup is that, you can also enter LIST #3 and it will LIST on the printer. Another thing you can do is with the LPRINT and LLIST commands. LPRINT#2 and LLIST #2 will go to the screen instead of the printer.

A number of years ago, I saw an article on one of the uses of the OPEN # command. This was originally intended for use with disks, however, it can also be used for printing without a disk system. The manner in which it was used was to enter “ะžะ ะ•N #2โ€. ะขาปะต 2068 will not let you enter “OPEN #2โ€ alone but it will let you enter “CLOSE #2โ€ by itself. To enter “ะžะ ะ•N #2” you must follow it with ะฐ comma (the comma ั–ั• the only punctuation mark that works) and one of the following letters in quotation marks:

  • “S” for the upper part of the screen.
  • “ะš” for the lower part of the screen (with something like PAUSE to keep the print on the screen)
  • “ะ ” for printing to the printer ยซะฐะฟัƒ kind as in “PRINT #3โ€

This will cause anything in a PRINT statement to ะ•ะž to where the letter indicates. The most useful way of entering this command is, “OPEN #2,โ€P”, After entering this command (whether immediate mode ะพะณ ั–ะฟ a program, everything in the program that is in a PRINT statement will go to the printer. The simplest way of redirecting the print to the screen is to enter “CLOSE #2”. I have seen one article that said to enter “ะžะ ะ•N #2,”S”, but, that to me is a waste of keystrokes and it still leaves the channel open.

I have found that the only channel that works that way is channel 2. You can use any one of the other 15 channels to send print statements to the printer, but, you must follow them with the command: “PRINT #(channel you are using);” followed by what you want printed. An example of this is as follows:

10 OPEN #5,"ะ "
20 PRINT #5;"Mary had a little lambโ€
30 CLOSE #5

A while back I found a little program โ€˜(I believe it was in TS HORIZONS) that works like a simple word processor. The original program was written as follows:

10 INPUT ะะข 21,0; ะะข 0,0; LINE ะ$
20 LPRINT A$
30 GO TO 10

What happens with this program when you run it, is a cursor appears on the top of the screen. As you enter letters they are printed to the top of the screen and the cursor moves ahead of the letters. The entered string does not have quotation marks. Almost everything works as normal except the down arrow. It is the BREAK key for this program. You can even use the CAPS LOCK for this program. You can enter GRAPHICS. When you key the ENTER key, what is on the screen is printed on the printer. The screen would then be erased. Of course, a full sized printer will not print the GRAPHICS. You can also use the ENTER key for a LINEFEED. For a full sized printer, you will have to have your printer driver loaded in and initialized.

I tried an alteration on the program by changing the 0,0 in line 19 to 1,0. Then I added a line 5 to print the numbers 1 through 5 all the way across the screen. I found that this line would remain on the screen at all times while the rest of the text would be erased with ENTER to print to the printer. I also found that corrections could be made to the text. I also tried putting a semi-colon after LPRINT AS. This had a drawback as one had to add spaces to fill the printers buffer or the entire text would not be printed out.

In the September issue of Time Designs Magazine, one writer asked if there was a way to get the 2068 to print direct to the printer without using a monitor. Tim Woods answered that he knew of no way of doing this. The next issue contained quite a few letters in answer to that question, but, none of them really gave an answer to do what the writer wanted. One of the answers gave me the following idea, but it still does not do what the writer wanted.

5 POKE 23692,2
10 LET A$ = INKEYS: PRINT ะ$;: LPRINT A$;
15 PAUSE 20
20 GO TO 5

The POKE 23692,2 makes the text on the screen scroll up when the screen fills instead of breaking out. The semi-colons after the A$ keeps the printing ะพะฟ one line, otherwise, there would only be one letter to a line. The PAUSE is necessary, as without it you would not be able to get your finger off ะฐ key fast enough so it wouldn’t repeat. What happens is that the printer will print out a line of text when the printer’s buffer is full or when you key ENTER. This program has a number of disadvantages. There is no cursor on the screen. You cannot delete screen letters with the 0 key. You can move the unseen cursor with the arrow keys and correct words on the screen, but, you cannot change what is in the printer’s buffer. The result is that your mistakes are still printed on the printer. You can still break out of the program with the CAPS SHIFT & BREAK keys. CAPS LOCK cannot be used.

I tried a number of ways to make a cursor appear in the text on this program. I had no luck. Maybe one of you might find a way.

Products

 

Downloadable Media

 
Scroll to Top