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



Michel:

As long as the CL program doesn't try to do anything with it such as copy it to 
another variable and then use the copy and as long as both RPG programs know 
what's going on and are prepared for it, there shouldn't be any problem. (I 
wouldn't bet a business life on it, but I'd go for a quarter...)

As a general approach to start with, DCL a *char(31) variable in the CL program 
and call RPG pgm1 with that variable as the parm. The RPG program defines a 
data structure based over the address of that parm with an (aligned) pointer 
subfield and sets the pointer value. The CL program then calls RPG pgm2 the 
same way and that program also defines a similar data structure over the parm. 
Seems to me that an (aligned) pointer subfield should get the pointer value 
that was set by RPG pgm1.

I haven't tried any of that, but it seems reasonable as a beginning. By DCL'ing 
a *char(31), there'll be enough memory for a 16-byte pointer to align without 
spilling over. The CL doesn't care what's going on with the content of the 
variable nor does it want to do anything except DCL it and name it as a parm.

BTW, I think Simon Coulter generally described a technique of handling pointers 
via CL in an IBM newsgroup quite a few years ago; maybe in 
ibm.software.os400.tips or ibm.os400.software.syspgmg. I believe his article is 
still in the newsgroup  via news.software.ibm.com. Also, maybe you can repeat 
this question on the MIDRANGE-L list to see if there are better answers.

Tom Liotta

rpg400-l-request@midrange.com wrote:

>   1. CL pgm and pointer variables (Michel Delisle)
>
>Is there a way in a CL program to store a pointer (*) returned by an RPG
>procedure which is needed by another RPG procedure ?
>
>The 3 types of variables someone can define with DCL (*DEC, *CHAR,
>*LGL) don't suit my needs. Is there another way to declare variables ?

--
--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertechgroup.com


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.