|
Hi Jim, What you need to do is convert the subroutine to a procedure, i.e. replace the BEGSR/ENDSR with P-specs, add a prototype defintions (D-spec type "PR") in the main part of the program and a matching procedure interface within the procedure. These define the parameters passed to the procedure. Then you can use it as you described, but without the percent sign: > C Eval BSDPuR = MoveMDYToDate(CMDPuR) Another advantage of converting to a procedure is that the procedure can have local variables. For more details, they're all in the ILE RPG Reference manual. I'm pretty sure they were available for V3R7, but not totally sure... HTH Peter Dow Dow Software Services, Inc. 909 425-0194 voice 909 425-0196 fax ----- Original Message ----- From: Jim Langston <jlangston@conexfreight.com> To: <RPG400-L@midrange.com> Sent: Wednesday, February 02, 2000 2:33 PM Subject: Using % type functions > V3R7M0 > > I have a program that uses a subroutine to move a variable from > a 6 digit numeric field to a true date field. > > It is called in the program like this: > > C Eval MDYDate = CMDPuR > C Exsr MoveMDYToDate > C Eval BSDPuR = RealDate > > The MoveMDYToDate is a simple subroutine that does a > TEST(D) and if there is no error sets the date using > a MOVE to the RealDate variable, if there is an error > it sets it to *LOVAL. > > What I would much rather do is something like: > > C Eval BSDPuR = %MoveMDYToDate(CMDPuR) > > Is this available to me in V3R7M0? At this time I > am only concerned with getting it to work within a > subroutine within my current program. After I get > that working well, I will most likely move it out > into a linkable object. > > How do I create a % type function? > > Regards, > > Jim Langston > > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.