|
d data_struct e ds extname(FileName) d @subProc pr d in@ds like(data_struct) c callp @subProc(data_struct) p @subProc b d pi d in@ds like(data_struct) c - calculations p e If you don't define the in@ds with VALUE, the values loaded in IN@DS, in your sub-procedure, will be loaded into data_struct upon return. David L. Mosley, Jr. Systems Analyst 2000 CentreGreen Way Suite 250 Cary, NC 27513 James Rich <james@eaerich.co To: <rpg400-l@midrange.com> m> cc: Sent by: Subject: passing data structure as function parm rpg400-l-admin@mi drange.com 10/11/01 02:42 PM Please respond to rpg400-l I want to pass a data structure as one of the parameters to a function (oops - I mean sub procedure). So I get something like this: caller: C eval err = get_data(data_struct) then called does: C z-add data data_struct.field1 C z-add data data_struct.field2 etc. returning to caller: C z-add data_struct.field1 field1 C z-add data_struct.field2 field2 I don't know how to do this in RPG. I'm at V4R1. Any help? James Rich james@eaerich.com _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.