|
Thanks Scott, I misunderstood 'varying'. I thought it meant that the it would accept inputs of various sizes, not inputs only defined as varying size. Tim -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Thursday, July 22, 2004 4:25 PM To: RPG programming on the AS400 / iSeries Subject: Re: Need help Hi Tim, > I must be brain dead, but I cannot figure out why this (PtRtrv) won't > compile. "Subr" is defined as 14A, fixed-length. Low2Up() only accepts VARYING fields as parameters. If you define the parameter to Low2Up as a CONST or VALUE parameter, the compiler will automatically convert the value for you. That's a good way to do this, since you're not returning the results via the parameter anyway, you're returning them via the return value. Passing the input parameter by CONST will make this routine more versatile when you want to call it from other programs where they might or might not use VARYING. Here's how I'd code the Low2Up() procedure. (Remember to change the prototype to match!) P Low2Up B Export D Low2Up Pi 1000A Varying D String Like(Low2Up) const D Options(*Varsize) D Upper C 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' D Lower C 'abcdefghijklmnopqrstuvwxyz' D RetVal s like(Low2Up) /free RetVal = %XLate(Lower:Upper:String); Return RetVal; /End-Free P Low2Up E -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx 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 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.