Mitsubishi MELFA CR1D Instruction Manual page 251

Table of Contents

Advertisement

Print (Print)
[Function]
Outputs data into a file
[Format]
Print[]#<File No.>[] [, [<Expression> ; ] ...[<Expression>[ ; ]]]
[Terminology]
<File No.>
<Expression>
[Reference Program]
1 Open "COM1" AS #1
2 MDATA=150
3 Print #1,"***Print TEST***"
4 Print #1
5 Print #1,"MDATA=",MDATA
6 Print #1
4 Print #1,"****************"
5 End
The output result is shown below.
***Print TEST***
MDATA=150
****************
[Explanation]
(1) If <Expression> is not described, then a carriage return will be output.
(2) Output format of data (reference)
The output space for the value for <Expression> and for the character string is in units of 14 characters.
When outputting multiple values, use a comma between each <Expression> as a delimiter.
If a semicolon (;) is used at the head of each space unit, it will output after the item that was last dis-
played. The carriage return code will always be returned after the output data.
(3) The error occurs when Open command is not executed.
(4) If data contains a double quotation mark ("), only up to the double quotation mark is output.
Example)
[1 M1=123.5
2 P1=(130.5,-117.2,55.1,16.2,0.0,0.0)(1,0) ]
1)[3 Print #1,"OUTPUT TEST",M1,P1]is described,
OUTPUT TEST
2)[3 Print #1,"OUTPUT TEST";M1;P1]is described,
OUTPUT TEST 123.5(130.5,-117.2,55.1,16.2,0.0,0.0)(1,0) is output.
If a comma or semicolon is inserted after a <Expression>, the carriage return will not be issued, and instead,
printing will continue on the same line.
3) 3 Print #1,"OUTPUT TEST",
4 Print #1,M1;
5 Print #1,P1 ]is described,
OUTPUT TEST 123.5(130.5,-117.2,55.1,16.2,0.0,0.0)(1,0) is output.
[Related instructions]
Open
(Open),
Close
(including communication lines)
Described with numbers 1 to 8.
Corresponds to the control No. assigned by the Open command.
Describes numeric operation expressions, position operation expressions and character
string expressions.
' Open standard RS-232-C line as file No. 1.20 Mov P_01.
' Substitute 150 for the numeric variable MDATA.
' Outputs the character string "***Print TEST****."
' Issue a carriage return
' Output the character string "MDATA" followed by the value of
' Issue a carriage return.
' Outputs the character string "**************."
' End the program.
123.5 (130.5,-117.2,55.1,16.2,0.0,0.0)(1,0) is output.
(Close),
Input (Input)
. All data uses the AscII format.
MDATA, (150).
Detailed explanation of command words 4-238
4MELFA-BASIC IV

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melfa cr2dMelfa cr3d

Table of Contents