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



Mike,

You're almost there, but not quite yet. :)

What you said about not having a problem with input parameters declared as
less than or equal to 32 bytes is true only when dealing with literals. That
"shortcut" doesn't work for program to program calls. Refer back to the
first example under the "CL Parameter Basics" section to see the problem
illustrated.

Keep things simple:

- always match the type/size of parameters on your pgm to pgm calls.
- remember that the system converts literals to variables in the background.
- remember that decimal literals are always converted to *DEC(15 5)
- and that char literals less than or equal to 32 bytes are converted to
*CHAR(32)
- and that char literals greater than 32 bytes are converted to variables of
equivalent size.

and last, but not least:

- the called program "sees" as much storage as it declares for an input
parameter, whether or not the caller actually allocated that much storage
for it.


John Taylor
Canada


----- Original Message -----
From: "Wills, Mike N. (TC)" <MNWills@taylorcorp.com>
To: <MIDRANGE-L@midrange.com>
Sent: Thursday, May 17, 2001 14:23
Subject: RE: CL Problems - Parameter Passing


> Wow! So what you are basically saying is that I shouldn't have a problem
if
> I use variable lengths less than or equal to 32, but I must use longer, to
> make sure they are the same size? (Which by the way was the case)
>
> Thanks for the background information!
>
> Mike
>


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 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.