What would be the evaluation of the "++" below
It isn't "C" - It's COBOL
It compiles with Micro Focus, Fujitsu, and GnuCOBOL
The execution acts upon it as if there is only a single '+'
I have never purposefully written such a statement
Thank you Denis.
It is obvious thanks to your example.
It is less than obvious when the object of the second plus sign contemplates a more complex expression than a single data element.
Thank you again !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What would be the evaluation of the "++" below
It isn't "C" - It's COBOL
It compiles with Micro Focus, Fujitsu, and GnuCOBOL
The execution acts upon it as if there is only a single '+'
I have never purposefully written such a statement
COMPUTE IBZ-REFMOD-STRT = IBZ-REFMOD-STRT
++ ((IBZ-W1 - 1) * USYM-ELEM-LEN) + 1
Compiling PLUSPLUS.COB...
Compilation complete with no errors
Build finished with no errors.
Completed in 1 seconds
Last edit: Ralph Linkletter 13 hours ago
Hi Ralph in fact the first + of the ++ expression is the addition operation . The second plus is interpreted as the sign of the field ie positive
here a little program to illustrate that .
Thank you Denis.
It is obvious thanks to your example.
It is less than obvious when the object of the second plus sign contemplates a more complex expression than a single data element.
Thank you again !