|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Brian Johnson
Sent: Friday, September 14, 2007 3:35 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Help me with my homework--I mean this subprocedure
For the math-challenged (assuming externally described printer file):
d pfldRange ds qualified
d min like( pfld ) inz( *loval )
d max like( pfld ) inz( *hival )
if val < pfldRange.min ;
pfld = pfldRange.min ;
elseif pval > pfldRange.max ;
pfld = pfldRange.max ;
else
pfld = pval ;
endif;
No fancy math required. If pfld is set in many places,
enclose in a procedure. Also has the advantage of automatic
adaptability
(compile-time) to changes to the width of pfld; no coding of
magic numbers that need to be kept in sync with the printer
file field size.
This mailing list archive is Copyright 1997-2026 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.