× 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 decision to use a procedure vs inline code is a tough one sometimes.
In this context, I would do a SETLL in the program and check %FOUND or
%EQUAL as the case may be.
But the criteria that the coder not need to know nor declare the file doing
the validation is also good justification for that 2-line procedure. If you
ever need to change that 2-line routine (to make it 3 lines, <g>) all you
need to do is change it in one location. Or, in your situation, if you ever
need to change the file name or do an additional check, all you have to do
is...

Those who don't use /COPY or don't use procedures because they "can't see
the code that's being run" are SEU users, typically, and also the same
people that are stuck working with those 5000+ line monolithic programs. So
yes, in that context, a single procedure won't help.

Bob

-----Original Message-----
From: rpg400-l-bounces@midrange.com [mailto:rpg400-l-bounces@midrange.com]
On Behalf Of Scott Mildenberger
Sent: Wednesday, February 12, 2003 2:54 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: "If %scan(x:y)" is not valid???


How about a two line subprocedure in a service
program.  I have many that do validation against a
file and only have a setll and a return %equal.  Then
any program that needs to do this validation can just
call VldRailroad(Road) and not have to include the
file in that program.  This simplifies program code
because each programmer doesn't have to know how to do
the validation.  Some validation routines are only the
two lines but some are much larger because the
validation is not so simple.



Scott Mildenberger

--- Dan <dbcerpg@yahoo.com> wrote:
> 
> But, I would never, ever, turn a one-line function
> into a subroutine, sub-procedure, or service
> program.  Blllleeeeaaaahhhh!
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.