× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm planning on requesting management approval
> for using free form RPG in our application.

For once I'll skip the political debate.

Does anybody has any reference materials
> about benefit of using free form

I don't know of any studies that provide hard data. As far as I know, there are no modern languages that are column based, and darned few old ones. If columns are so great why doesn't every language use them?

You definitely have to think about the earliest release of OS400 you are going to support.

Finally, free form is about how the code 'looks.' There are some enhancements that are free-form only, and there are some operations that free-form does not support (CALL, GOTO, MOVEx are the big ones).

This is my personal opinion only, but I have no problem mixing free and fixed operations together:

     c     *entry        plist
     c                   parm                    full_path
     c                   parm                    dirname
     c                   parm                    basename
     c                   parm                    extn
     c                   parm                    rtncode

      /free

        // initialisation
        dirname  = *blanks;
        basename = *blanks;
        extn     = *blanks;
        rtncode  = UNKNOWN;

or

       // no input, normal exit
       if full_len = 0;
         rtncode = NORMAL;
      /end-free
     c                   goto      skip_tests
      /free

Other people find this ugly. I find that the occasional jump back to traditional format attracts my eye to these exceptional areas; places where something strange or special happens.

Be advised that other programmers in your group may have a very different idea about what is pretty or ugly code than you. Personally I don't find it hard to adapt to the styles of my coworkers. Some people like:

basename = %subst(full_path: path_demarc+1: basename_len);

and some like:

basename = %subst(full_path:
                  path_demarc+1:
                  basename_len);

Both run as fast, compile as fast and are simple to modify. All that's left is the argument as to which looks better. In my group, I proposed a set of standards for indenting and let the group decide whether to adopt them, modify them or let everyone do what they want. Since I am the senior guy, they decided to do whatever they want. <grin>

Just be prepared to have possible long debates over indentation rules and other 'matters of style.' To prepare yourself, look up what the Visual Basic people were arguing about in 1980, or the C people were debating in 1970.

> and may be a quick guide of syntax of free
form that I can use?

The RPG Reference is the only thing I ever use. In the Infocenter at http://www.iseries.ibm.com/infocenter I always download the latest PDF so I don't have to go online for reference.
  --buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.