11 - 402 11 - 402
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
WIDTH
Instruction
WIDTH
• Sets the width of data to be output to the printer.
WIDTH LPRINT <output width>
Syntax
output width
• • • •
Specify the output width of one line using a value
from 30 to 255.
Examples
WIDTH LPRINT 100
• • • •
Sets the width of data to be output to the printer to
100 characters per line.
Description
• The WIDTH instruction sets the output width (the maximum number of characters per line)
when printing data output to the printer specified by the ZLDV instruction.
• If a character string longer than <output width> is specified to be printed in one line after
executing the WIDTH instruction, the number of characters specified by <output width> is
printed and then the remaining characters in the string is printed in the new line.
• If the value specified in <output value> is 255, it is interpreted as if the output width is
infinite; the CR (carriage return) code is not sent to the printer.
• The output width is set to 80 characters as default when BASIC is started up.
Program Example
10 ' This program specifies the output width of data output to the printer and prints a character string
20 A$="MitsubishiPLCAD51H.ABCDEFGHIJKLMNOPQRSTUVWXYZ,1234567890,@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
:
' Defines a character string
30 WIDTH LPRINT 50
:
' Sets the output width to 50 characters
40 LPRINT A$
:
' Outputs the character string to the printer
50 WIDTH LPRINT 80
:
' Sets the output width to 80 characters
60 LPRINT A$
:
' Outputs the character string to the printer
70 END
MitsubishiPLCAD51H.ABCDEFGHIJKLMNOPQRSTUVWXYZ,1234567
890,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@
MitsubishiPLCAD51H.ABCDEFGHIJKLMNOPQRSTUVWXYZ,1234567890,
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@
REMARK
See the LFILES, LLIST, LPRINT, LPRINT USING, PRINT#, PRINT# USING, and
ZLDV instructions.