|
Parameters with CONST will not be allowed to be modified in the procedure. The compiler will issue a syntax error. If you ONLY remove CONST from the prototype and do that after you compiled the procedure itself, you are tricking the compiler but the procedure will not be changed. You need to modify the PR and the PI statements, removing CONST from the parms you want to modify within the procedure. In the case of a program, if the called program uses PR/PI instead of an *ENTRY PLIST, then you again have to match up the parm definitions. If you're using *ENTRY PLIST, then all parms in the program may be changed. If you are modifying the parameters on your *ENTRY PLIST and specifying CONST on the prototype, I think you'll have a learning experience. In this situation, it is up to you to avoid being bad and changing the data in those parameters. -Bob Cozzi -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai Sent: Tuesday, January 18, 2005 9:19 AM To: RPG programming on the AS400 / iSeries Subject: RE: Error code on extpgm? it should work. Check the length of each fields define in PR match the length of the parm fields of the program. AFAIK, if caller pass the correct length, const keyword has no effect. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of RPower@xxxxxxxxxx Sent: Tuesday, January 18, 2005 7:42 AM To: RPG programming on the AS400 / iSeries Subject: Re: Error code on extpgm? I removed the const on the E_Errcde field. But I still don't get back a value though. Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 Tel: 709-576-8132 Email: rpower@xxxxxxxxxx Website: http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill RPower@xxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 18/01/2005 09:34 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject Error code on extpgm? Since I'm still a little new at this procedures stuff. What is the correct way to get say an error code value to be returned? Here's my current definition: I was using this api this way: c* Call 'SENDEMAIL' Jan 11, 2005 R.Power c* Parm UserId Email_Code Jan 11, 2005 R.Power c* Parm *Blanks From Jan 11, 2005 R.Power c* Parm Filename Jan 11, 2005 R.Power c* Parm Subject Jan 11, 2005 R.Power c* Parm Errcde Jan 11, 2005 R.Power hence, I'd check errcde for a value. Now that I've decided to make it a procedure, here's what I have: D*-------------------------------------------------- D* Procedure name: Send_Email D* Purpose: Send email to user D* Returns: D* Parameter: Email_Code D* Parameter: MsgLen D* Parameter: MsgType D* Parameter: MsgWrkStn D* Parameter: MsgWrk# D* Parameter: MsgMsgQ D* Parameter: MsgError D*-------------------------------------------------- D Send_Email PR EXTPGM('SENDEMAIL') Jan 18, 2005 R.Power D E_Code 10A Const Jan 18, 2005 R.Power D E_From 50A Const Jan 18, 2005 R.Power D E_Filename 100A Const Jan 18, 2005 R.Power D E_Subject 50A Const Jan 18, 2005 R.Power D E_Errcde 3A Const Jan 18, 2005 R.Power ?* Use api to send email with attachment to user profile running software c CallP Send_Email(UserId:*Blanks:Filename:Subject: Jan 18, 2005 R.Power c Errcde) Jan 18, 2005 R.Power Can I still check Errcde for the value returned or do I have to setup something different because of the way it's passed back and forth? Thanks, Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 Tel: 709-576-8132 Email: rpower@xxxxxxxxxx Website: http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill -- 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. -- 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. -- 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-2025 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.