All BASIC commands
Section 4-2
217
4-2-186 PRINT
/i
/i
/i
Type
I/O command
Syntax
PRINT [ #n, ] expression { , expression}
? [ #n, ] expression { , expression }
Description
The
command outputs a series of characters to the communica-
tion ports.
can output parameters, fixed ASCII strings, and single
ASCII characters. By using
PRINT #n
, any port can be selected to out-
put the information to.
Multiple items to be printed can be put on the same line separated by a
comma or a semi-colon. A comma separator in the print command
places a tab between the printed items. The semi-colon separator prints
the next item without any spaces between printed items.
The width of the field in which a number is printed can be set with the
use of [w,x] after the number to be printed. The width of the column is
given by w and the number of decimal places is given by x. Using only
one parameter [x] takes the default width and specifies the number of
decimal places to be printed. The numbers are right aligned in the field
with any unused leading characters being filled with spaces. If the
number is too long, then the field will be filled with asterisks to signify
that there was not sufficient space to display the number. The maximum
field width allowable is 127 characters.
The backslash
\
command can be used to print a single ASCII charac-
ter.
Arguments
•
n
The specified output device. When this argument is omitted, the port
is 0 (Terminal window). See the table below.
Value
Description
0
Programming port 0 (default)
5
Trajexia Studio port 0 user channel 5
6
Trajexia Studio port 0 user channel 6
7
Trajexia Studio port 0 user channel 7
•
expression
The expression to be printed.
Example
PRINT "CAPITALS and lower case CAN BE PRINTED"
Example
Consider VR(1) = 6 and
variab
= 1.5, the print output will be as follows:
PRINT 123.45, VR(1)-variab
123.4500 4.5000
Example
length:
PRINT "DISTANCE = ";mpos
DISTANCE = 123.0000
In this example, the semi-colon separator is used. This does not tab into
the next column, allowing the programmer more freedom in where the
print items are placed.
Example
PRINT VR(1)[ 4,1 ]; variab[ 6,2 ]
6.0 1.50
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...