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



Barbara,

I was not yet aware of that you can add the extproc keyword to the procedure interface of an internal procedure.

That' cool!

Thank you,

Thomas.


-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Barbara Morris
Gesendet: Mittwoch, 1. Februar 2017 22:42
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: Procedure Examples VR7.1

On 2017-02-01 4:13 PM, Tools/400 wrote:
...
But I do not agree with you regarding the EXTPROC keyword. Reading a
stack trace or an error message is a lot easier, when the procedure
name is shown in camel case. Just my opinion and not necessarily yours. ...

For internal procedures, you don't need a prototype starting in 7.1.

I agree that it's much nicer for the joblog, stack trace etc to have the name in camel case.

But if you use free-form declarations (available starting in 7.1), you can avoid typing the procedure name twice by using EXTPROC(*DCLCASE).
That will cause the external name to have the same case as you used for the prototype itself, or for the procedure if you don't use a prototype.

If you do code a prototype, put extproc(*dclcase) on the prototype:

dcl-pr c2f zoned(5:2) extproc(*dclcase);
$c zoned(5:2) value;
end-pr;

If the procedure is internal and you don't code a prototype, code the procedure like this, putting the extproc(*dclcase) on the PI.

dcl-proc c2f;
dcl-pi *n zoned(5:2) extproc(*dclcase);
$C zoned(5:2) value;
end-pi;
dcl-s $F zoned(5:2);

eval(h) $F = (($C * 1.8) + 32); // use rounding
return $C;
end-proc;

--
Barbara

--
This is the RPG programming on the IBM i (AS/400 and 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.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.


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.