Mitsubishi Electric CR750-Q Instruction Manual page 256

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

4MELFA-BASIC V
(3) A run-time error occurs under the following conditions.
*The counter's <Default Value> is greater than <End Value> and <Increment> is a positive number.
*The counter's <Default Value> is smaller than <End Value>, and <Increment> is a negative number.
(4) A run-time error occurs if a For statement and a Next statement are not paired.
(5) When the Next statement corresponds to the closest For statement, the variable name in the Next state-
ment can be omitted. In the example, "M2" in step 5 and "M1" in step 6 can be omitted. The processing
speed will be slightly faster to omit the counter variable.
(6) In the For, it can escape to the next step of the Next by Break. That is, process of the For-Next can be
skipped.
FPrm (FPRM)
[Function]
Defines the order of the arguments, the type, and number for the main program that uses arguments in a
sub program (i.e., when the host program uses another program with Call P).
[Format]
FPrm[]<Dummy Argument> [,<Dummy Argument>] ...
[Terminology]
<Dummy Argument>
[Reference Program]
<Main program>
1 M1=1
2 P2=P_Curr
3 P3=P100
4 CallP "100",M1,P2,P3
<Sub program "100">
1 FPrm M1,P1,P2
2 If M1=1 Then GoTo *LBL
3 Mov P1
4 *LBL
5 Mvs P2
6 End
[Explanation]
(1) FPrm is unnecessary if there are no arguments in the sub program that is called up.
(2) An error occur when the type or number is different between the argument of CallP and the dummy argu-
ment that defined by FPrm.
(3) It is not possible to pass the processing result of a sub program to a main program by assigning it in an
argument.
To use the processing result of a sub program in a main program, pass the values using external vari-
ables.
[Related instructions]
CallP (Call P)
4-236 Detailed explanation of command words
The variable in the sub program that is transferred to the main statement when
executed. All variables can be used. Up to 16 variables may be used.
' It can be described like "CallP "100", 1, P_Curr, P100" also.
' Return to the main program.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents