|
No, that is the reverse of what I want to do. Basically what I am doing in using /COPY to copy the data structures defined for the OS/400 API's into my program, which are held in QRPGLESRC in QSYSINC. If I want to set pointers up for each data structure for a particular API, I would have to amend that source. The problem with that is that the QSYSINC library will be possibly updated at each upgrade. Now you may ask, why do I need to set up a pointer to each DS for a particular API. Basically because I assume that setting a pointer would be faster than %SUBST. If you only have a pointer to a userspace, you would currently: D APIdatastructure DS D DSSpaceVar S 32767 Based(SpcPtr) C DO Noofdataitems C Eval APIdatastructure = %SUBST(DSSpaceVar:1:%LEN(APIdatastructure)) Put Data Item into datastructure C EXSR PROCES Process Data Item C Eval SpcPtr = SpcPtr + NextItemOffset Set Var to Next Data Item C Enddo But what I would like to be able to do, taking the assumption that it would be quicker is: D APIdatastructure DS D Ptr * Pointer to User Space C Eval SpcPtr = Ptr + Offset Set Pointer To First Data Item C DO Noofdataitems C Eval %ADDR(APIdatastructure) = SpcPtr Put Data Item into datastructure C EXSR PROCES Process Data Item C Eval SpcPtr = SpcPtr + NextItemOffset Set Var to Next Data Item C Enddo I am assuming here that using pointers is much faster that substringing charcter strings Correct me if I am wrong, I am here to be enlightened. -----Original Message----- From: Jon.Paris@halinfo.it [mailto:Jon.Paris@halinfo.it] Sent: Friday, May 14, 1999 12:51 PM To: MIDRANGE-L@midrange.com Subject: Basing Pointers >> What I want is to be able to assign this at run time eg: >> EVAL %ADDR(DSdatastructure)=Ptr Since you can already do this simply by coding like this: D DSdatastructure DS Based(DS@) D Eval DS@ = Ptr I really don't see the point. It would also I suspect be a major cause of errors since looking at the DS definition would give you no hint that it was subject to moving around the universe!! +--- | 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 +--- +--- | 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 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.