Special print formatting statements – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 70

Advertising
background image

Operating Functions

Chapter 5

5–33

The following sections list and describe the special print formatting
statements.

5.4.22.1
PRINT TAB([expr])

Use the TAB([expr]) function in the PRINT statement to cause data to print
out in exact locations on the output device. TAB([expr]) tells the BASIC
Module which position to begin printing the next value in the print list. If
the printhead or cursor is on or beyond the specified TAB position, the
module ignores the TAB function.

Example:

uPRINT TAB(5),“X”,TAB(10),“Y”

X

Y

5.4.22.2
PRINT SPC([expr])

Use the SPC([expr]) function in the PRINT statement to cause the BASIC
Module to output the number of spaces in the SPC argument.

Example:

u PRINT A,SPC(5),B

Use the above statement to place an additional 5 spaces between the A and
B in addition to the two that would normally print.

5.4.22.3
PRINT CR

Use CR in a PRINT statement to force a carriage return, but no line feed.
You can use CR to create one line on a CRT device that is repeatedly
updated.

Example:

u 10 FOR I=1 TO 1000

u20 PRINT I,CR,

u30 NEXT I

The above example causes the output to remain on one line only. No line
feed is ever sent to the console device.

5.4.22
Special Print Formatting
Statements

Advertising