Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 77

Advertising
background image

6Ć37

This prints as follows:

567THIS IS STRING1THIS IS STRING2 98 FALSE

1 SPACE BEFORE BOOLEAN
1 SPACE BEFORE NUMERIC
NO SPACES BEFORE STRING FIELD
NO SPACES BEFORE STRING FIELD

The semicolon can be used at the beginning of a statement to

prevent zoning of the first item printed. The semicolon can also be

used at the end of a PRINT statement to tell BASIC not to advance

the print pointer to the next line after the print occurs but to leave it

at the end of the line. This is useful when an INPUT statement

immediately follows the PRINT statement.
In Enhanced BASIC, all decimal numbers have 8 digits of

significance. Therefore, only 8 digits can be printed for the number,

whether it is very small or very large. To print very large numbers or

very small numbers, a scientific or exponential format must be used.
For example, the numbers 1.7634736E+17 and 2.8876582E-09

only have 8 digits of precision printed but use scientific notation to

show the number of decimal places to the right or left where the real

decimal point would be placed.
In BASIC, unformatted (using the PRINT statement instead of the

PRINT USING statement) decimal numbers are printed according to

the following rules:
1. BASIC will attempt to locate the decimal point such that there is

no need for an exponent.
Example: 123.45678 or 0.12345678 or 1234567.8

2. If this is not possible, the number will arbitrarily be printed with

one number to the left of a decimal point and an exponent or

scientific notation will be used.
Example: 3.7836524E+12 or 4.8873633E-17

3. If the number is a true fraction and requires no exponent, there

will always be a leading zero in front of the decimal point.
Example: 0.98272635 or 0.18735354 or -0.87725433

PRINT USING allows you to print numeric fields with a specific

number of decimal places and field width:

PRINT USING #logical_device_number,formatted_ print_ list

where:

logical_device_number =

the logical number assigned to a device(PRINT

USING to a channel is not permitted) during an

OPEN statement. If no device number is given,

default device is PORTA on the Processor

module on which the task resides. Most

application task I/O can be handled through

the default port.

Advertising
This manual is related to the following products: