× 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.



The problem with this idea is that you're required to have one for each field you need to do this to.

Where as with Mike's procedure, you write it once and then just:

Pfld1 = GetPrintVal(Ffld1:%len(pfld1):%decpos(pfld1));
Pfld2 = GetPrintVal(Ffld2:%len(pfld2):%decpos(pfld2));
Pfld3 = GetPrintVal(Ffld3:%len(pfld3):%decpos(pfld3));

Charles


-----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 e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.