Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 72

Advertising
background image

Operating Functions

Chapter 5

5–35

5.4.22.6
PRINT USING(#.#)

This forces the module to output all numbers using an integer and/or
fraction format. The number of “#”’s before the decimal point represents
the number of significant integer digits that are printed and the number of
“#”’s after the decimal point represents the number of digits that are
printed in the fraction. Omit the decimal point to print integers only. You
may use the abbreviation U for USING. USING(###.###),
USING(######) and USING(######.##) are all valid in the BASIC
Module. The maximum number of “#” characters is 8. If the module
cannot output the value in the desired format (usually because the value is
too large) a question mark (?) is printed to the console device. BASIC then
outputs the number in the FREE FORMAT described below (refer to
section 5.4.22.7).

Example:

u10 PRINT USING(##.##),1,2,3

u20 FOR I=1 TO 120 STEP 20

u30 PRINT I

u40 NEXT I

u50 END

uRUN

1.00

2.00

3.00

1.00
21.00
41.00
61.00
81.00

? 101

READY

Important: The USING(Fx) and the USING(#.#) formats always “align”
the decimal points when printing a number. This makes displayed columns
of numbers easy to read.

5.4.22.7
PRINT USlNG(0)

This argument lets the BASIC Module determine what format to use. If the
number is between +/–99999999 and +/–.1, BASIC displays integers and
fractions. If it is out of this range, BASIC uses the USING (F0) format.
Leading and trailing zeros are always suppressed. After reset, the module
is placed in the USING(0) format.

5.4.22
Special Print Formatting
Statements (continued)

Advertising