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



AGlauser@xxxxxxxxxxxx wrote:

This *seems* to work fine - my concern is the fact that my CL varibles are *CHAR while my RPG parameters are expecting dates. How safe is it to do what I'm doing here?


In this case, it's quite safe because dates, times, and timestamps are pretty much string values at the parameter-passing level.

It wouldn't be safe to pass a character variable by value if the actual parameter was float or integer.

There are two types of parameters at the low level (a level way below RPG): scalar and aggregate. Integer, float, and pointer are scalar; string types and DTZ types are aggregate*; I'm not sure about packed and zoned. I don't know the exact mechanisms, but scalar parameters are passed by value differently from aggregate parameters, so you can't mix and match.

If you want to be really safe, you would create a wrapper procedure for CL to call, with character parameters, that you pass on to the real procedure using %DATE(parm). Or the wrapper could pass the parameters by reference, and pass them on directly to the real procedure.

* With EXTPROC(*CWIDEN|*CNOWIDEN) single-char alpha and single-char unicode are handled as scalar.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.