|
Hi Nick, A pointer is a data type just like any other: d Name s 40a d pName s * So when the proc is prototyped, a parm that is data type pointer is declared just like one that is data type character: d pInName * value d InName 40a value Here is a proc that receives a pointer as its sole parameter. It displays the data that the pointer points to. ** ------------------------ DsplyName -------------- p DsplyName b d DsplyName pi d pInName * value d Name s 40a based(pInName) /free dsply Name ; /end-free p e And the following code calls the proc, passing a pointer to the data to be displayed: d Name s 40a d pName s * /free Name = 'Simon & Schuster' ; pName = %addr(Name) ; DsplyName( pName ) ; return ; -Steve -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Nick Leonessa Sent: Thursday, April 24, 2003 9:26 PM To: RPG Forum Subject: Passing Parms Between RPG programs using Pointer I wrote an RPG program to list members of a database file using API's. I have the results of the API loading into an array. I would like to be able to pass the results of this program to any other program that may need it. I know that passing information via pointers if faster, but I'm not sure how to do this. Any suggestions. Thanks. Nick 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.cgi/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-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.