Basic Programming - Oki MICROLINE 385/6 Handbook

Table of Contents

Advertisement

Basic Programming
The LPRINT command in BASIC makes output go to the printer rather than to th
To send text to the printer, simply enclose the words in double quotes:
LPRINT "Aline of text"
The statement above prints the line of text, and then moves the printing posit
beginning of the next line. If you do not want this automatic carriage return and
put a semicolon (;) after the data:
LPRINT "A line of text";
LPRINT"... and this text is on the same line"
Keep in mind, however, that BASIC automatically adds a carriage return and line
the 80th character in a line. If necessary, you can use a WIDTH statement to ch;
For serial printers
If you are using your printer with a serial interface, you have to be sure to redirt
from the computer to the serial port you are using, either COM1: or COM2:, rath
the default port, LPT1:. There are two ways to do this:
1 . If you are using DOS, you can use the MODE command. Then, use the
command in your BASIC programs, just as we do in our examples.
2. You can also redirect output to COM1: or COM2: from within BASIC, by openin
as a file and printing your data to that file. If you want to run any of our sample p
you will need to modify them. At the beginning of your program, include one
statements:
OPEN "COM1:9600,N,8,1" AS #1
or
OPEN "COM2:9600,N,8,1" AS #1
Then, to print data, use the PRINT# 1 command, being sure to include a comma
the # 1 and the data:
PRINT#1, "A line of text"
Like the PRINT command, PRINT# 1 automatically moves the print position to the
unless you use a semicolon (;) after the data.
When you send an LPRINT statement, the text between the quotation marks is с
to a string of numbers, which are then processed by the printer and output a
patterns that make up the individual characters. Each character is assigned a
value according to the American Standard Code for Information Interchange

Advertisement

Table of Contents
loading

This manual is also suitable for:

Microline 385Microline 386

Table of Contents