Programming Languages

Most users rely on application programs to send commands to the printer. However, an awareness of programming languages can be helpful in exploring a printer’s potential or troubleshooting a printing problem.

For example, you might want to set up your application program to send a command for italic printing. You can use a programming language, such as BASIC or Pascal, to do a quick printout before setting up the program.

Or, perhaps you’ve set up a program to send a certain command to the printer, but its not printing correctly You could send the same command with a programming language to find whether the problem lies with your application program, the command, or the printer,

Sending printer commands with BASIC

You can send printer commands with any programming language. The examples in this manual are written in BASIC, because BASIC is included with most computer systems.

Most forms of BASIC use the LPRINT statement to send print commands and other output to the printer

To send individual printer commands. use the LPRINT statement and the CHRS function. For example, to send the command for italic, first check the LQ Command Summary for the proper command-W 4.

BASIC allows you to send commands in three different ways. If a printable character corresponds to the command (4 in the case of italic), then you can use that character, if it’s enclosed in quotation marks:

LPRINT CHR$(27);"4"

Or, you can send the decimal or the hexadecimal equivalent of the command (Microsoft” BASIC requires that &H precede all hex codes):

LPRINT CHFi$(27);CHRS(52);

or

LPRINT CHR$(&H1B) (&H34);

Using the LQ-2500 with Application Programs

4 - 1 1