Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28591 Discussions

Multiple Assignments in one statement

mcarpen
Beginner
472 Views
I am re-hosting my current fortran sources from Visual Studio 4.x to Intel Fortran 7. I have many occurrences of multiple assigns in a single statement..
e.g.
a=b=c=d=1.0
This is apparently not allowed by the latest version.
Can anyone tell me if there is an option for the compiler to allow multiple assigns..
Re-writing the sources would be a very labor intensive project.
Thanks in advance for you help.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
472 Views
Did MS Fortran allow that? Yuck! It's not standard Fortran and isn't syntax I've ever seen before in any Fortran compiler. You're going to have to rewrite it.

Steve
0 Kudos
TimP
Honored Contributor III
472 Views
CDC Fortran recognized multiple assignment, but that was 30 years ago, before the '77 standard began to approach reality. Everyone knew it wasn't portable and never would be.
0 Kudos
kdkeefer
Beginner
472 Views
Actually, if I recall correctly, MS Powerstation allowed such assignments. I used it once and quickly realized it was a bad idea. Even if you have a lot of these, you can change them quite easily with the text editor-- an "enter" after each "=", save a "1.0" in the paste buffer and "cntl v" it in. It may be tedious, but so is raking leaves and this only has to be done once.
Keith
0 Kudos
Steven_L_Intel1
Employee
472 Views
Note that the following is standard Fortran:

A = 1.0; B = 1.0; C = 1.0; D = 1.0;

Steve
0 Kudos
Reply