×
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.
Free-form is, at first, hard to explain in an email. On the other hand, it
means what its name implies: RPG (Calc specs, anyway) are not restricted to
specific columns.
Most of the examples posted to the forum are in free format. The free
format versions of most op-codes are described in the RPG Reference manual.
One needs to learn the BIFs available, such as %found(), because one of the
gotchas, if you will, is that one cannot set resulting indicators since
there are no columns.
Not all RPG/400 op-codes can be used in free form RPG. The most notable, by
the number of questions asked regarding alternatives, is any variant of
MOVE. EVAL for the most part replaced MOVE - except that both sides of the
EVAL must both be the same data type, and unlike MOVE it burps on overflow
of the result, which was Sam's problem. The word EVAL is actually optional
in most cases; i.e., unless you need one of the extenders.
My ex-boss, who was a VB and .Net programmer, never could (he said)
understand RPG. Once I came on board and started using free form, he could
and did help debug RPG code. As a Math major, he liked the fact that a
complicated formula could be contained in a single line, rather than 2-n
lines in fixed format.
James Martin wrote a good book on Free-Format RPG available at, I think,
MCPressOnline.Com.
Jerry C. Adams
IBM i Programmer/Analyst
He is a self-made man and worships his creator. -John Bright on Benjamin
Disraeli
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: truncating a decimal value in /Free, (continued)
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.