PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Join the forum, it's quick and easy

PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

FREE FORMAT RPG Rules

Go down

FREE FORMAT RPG Rules Empty FREE FORMAT RPG Rules

Post  maran Fri Dec 30, 2011 1:07 pm

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.
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum