FREE FORMAT RPG Rules
Page 1 of 1
FREE FORMAT RPG Rules
A Few Rules
There are a couple of other things to know about free-formed calculations:
You can mix them in with traditional calc specs, as long as you code the /free and /end-free correctly. This includes code brought into the program from the /copy directive.
You cannot use resulting indicators in free-formed format; you must use the appropriate built-in functions to determine file and record retrieval status.
If you have a long expression, you can continue on the next line by simply typing on the next line and not placing a semicolon at end of the first line. This is allowed because, with fee-formed calculation specs, all white space is ignored. The following is an example:
// long calculation
Sum = Number1 + Number2 + Number3 + Number4
+ Number5 + Number6;
You cannot define fields inside a free-formed block. You must use D-specs to define your variables. This is actually a good thing, since you should never define fields in a C-spec.
As with Java, you must end a statement with a semicolon.
Finally, comments are identified with a double slash (//), as opposed to an asterisk (*), in column 7. In addition, comments can be placed on a separate line, or on the same line, after the semicolon.
There are a couple of other things to know about free-formed calculations:
You can mix them in with traditional calc specs, as long as you code the /free and /end-free correctly. This includes code brought into the program from the /copy directive.
You cannot use resulting indicators in free-formed format; you must use the appropriate built-in functions to determine file and record retrieval status.
If you have a long expression, you can continue on the next line by simply typing on the next line and not placing a semicolon at end of the first line. This is allowed because, with fee-formed calculation specs, all white space is ignored. The following is an example:
// long calculation
Sum = Number1 + Number2 + Number3 + Number4
+ Number5 + Number6;
You cannot define fields inside a free-formed block. You must use D-specs to define your variables. This is actually a good thing, since you should never define fields in a C-spec.
As with Java, you must end a statement with a semicolon.
Finally, comments are identified with a double slash (//), as opposed to an asterisk (*), in column 7. In addition, comments can be placed on a separate line, or on the same line, after the semicolon.
Similar topics
» Do the multi format logical file need to have same key field attributes for each record format? what is the significance of K *None in such Logical files?
» Multiple Format LF
» How can previous screen be retained
» What are 'Access Path’ format entries?
» Read using record format or File name
» Multiple Format LF
» How can previous screen be retained
» What are 'Access Path’ format entries?
» Read using record format or File name
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|