Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Free-Form RPG

Status
Not open for further replies.

Ju5

Programmer
May 25, 2007
85
0
0
PH
I've recently started using Free-form RPG in my programming and I just wanted to share a few things I've learned. Here's a list of basic things I've learned working with Free-form format:

1. To use Free-form the code should be enclosed inside the
following tags:
/FREE
code
.
.
.
/END-FREE

2. All statements MUST end with a semicolon(;)

3. The Result field is loacted at the left of the operation:
Sum = A + B;
Temp = 'abc';

4. The Equal sign(=) is used in place of the MOVE operation.

5. The %EOF(filename) command removes the need to set an Eof indicator in the READ statment.

6. Free-form is not position specific. Code can be indented for better readability.


 
Scanning through all of the bifs is of great benefit when starting to use free. Not need to know their exact syntax, but just knowledge of their existance will help alot.



- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and I really like that cold beer that should be every mans right after a hard days work!
 
>> 3. The Result field is loacted at the left of the operation:
Same as fixed-format EVAL command, which is what this is.


>>4. The Equal sign(=) is used in place of the MOVE operation.

Not exactly. The MOVE command is not available in free-format. You are using the EVAL here, which is almost the same as a MOVE. However, MOVE allows char > num, num > char and a result field shorter than factor2. There are workarounds to make EVAL do this type of thing.

>>5. The %EOF(filename) command removes the need to set an Eof indicator in the READ statment.

Same as fixed-format.

NOTE: A real easy way to learn free-format: In the editor with fixed-format, simply click "Convert selected to free-form" or "Convert All to free-form" and you get converted and indented code.

>> through all of the bifs is of great benefit when starting to use free

Not just free, either. The (lpex) editor has a built in IDE. Put in the bif, press ctrl-space and up pops all the options. Press F1 and see the page in the RPG manual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top