fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
CHANGE MULTIPLE ASSIGNMENTS TO SEPARATE STATEMENTS
Syntax:
[DO NOT] CHANGE MULTIPLE ASSIGNMENTS TO SEPARATE STATEMENTS
Function:
Multiple assignment statements are statements of the form, for example,
I=J=K=0
They are accepted by some, but not by all, Fortran systems. This command converts them to separate statements. Note that there are two ways in which this could be done. The statement:
R1=R2=R3=RFUN(I,P)
could be converted to:
R1=RFUN(I,P) R2=RFUN(I,P) R3=RFUN(I,P)
or to
R3=RFUN(I,P) R2=R3 R1=R2
Usually, the final right-hand side quantity is a constant or does not change in the execution of the multiple assignment, so the two alternatives are equivalent. If the right hand side is a function or an expression containing any of the variables assigned, the alternatives can produce different results. fpt generates code using the second convention, which is the observed behaviour under Encore (Gould-SEL) MPX Fortran. A diagnostic is embedded in the code to indicate that a change has been made. For example:
R3=RFUN(I,P) !------------^-------------------------------------------------- !!! fpt - 2282 Multiple assignment statement has been separated !--------------------------------------------------------------- R2=R3 R1=R2
The diagnostic may be suppressed by the SUPPRESS ERROR command.
Where to Use this Command
Operating system command line | Yes |
Configuration file, config.fsp | Yes |
Specification (fsp) files, *.fsp | Yes |
Interactively, to FPT> prompt | Yes |
Interactive command files | Yes |
Embedded in the Fortran code | No |
Default:
No change is made by default.
See Also
Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.