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




Manuel,

FWIW, you can prototype the API's so you don't have to move in and out
of free-form.

// Actual prototype from one of my programs
dGetSpcPtr pr ExtPgm('QUSPTRUS')
d ##_usrspc 20
d ##_usrspc@ *

d NameToUse pr ExtPgm('APIName')
d APIUsrSpc 20a
d APILstFmt 8a
d Obj 20a
d APIErr 256a

Then in your code the calls become

GetSpcPtr(##_usrspc :##_usrspc@);
NameToUse(APIUsrSpc :APILstFmt :Obj :APIErr);

I have created a module that creates a user space and returns a pointer
to it. I'm pretty sure the code has been posted to the Midrange code
section. You might check the archives for a link. If you do much with
user spaces it comes in pretty handy. Don't forget that user spaces
aren't just for API's.

Rick

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Manuel Cerda
Sent: Tuesday, April 08, 2008 5:40 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: retrieve service program list of procedures

Thanks a lot for your help Rick and Adam, Now it works fine here's my
draft code for info ;

D APIUsrSpc S 20 Inz( 'MODL0100 MYDEV ' )
D PgmLAPI S 10 Inz( 'QBNLMODI' )
D PgmLFmt S 8 Inz( 'MODL0100' )

D pUserSpace S *
D genericHeader DS based(pUserSpace)
D headerOffset 117 120i 0
D headerSize 121 124i 0
D listOffset 125 128i 0
D listSize 129 132i 0
D numEntries 133 136i 0
D entrySize 137 140i 0

D DS based(pEntry)
D ApiSizeOfEntry 10i 0
D ApiModule 10a
D ApiModuleLib 10a
D ApiSymbolType 1a
D ApiReserved2 3a
D ApiOffSetExpSy 10i 0
D ApiLengthExpSy 10i 0
D ApiArgOptr 10a


D ApiProc s 128a based( papiproc )
D ApiProc2 s 128a Varying

/free
CrtUsrSpc( APIUsrSpc );

l APINam = PgmLAPI;
APILstFmt = PgmLFmt;

/END-FREE

C Call APINam
C Parm APIUsrSpc
C Parm APILstFmt
C Parm Obj
C Parm APIErr

* Get a pointer to the user space containing the list
C call 'QUSPTRUS'
C parm ApiUsrSpc
C parm pUserSpace

/free

pEntry = pUserSpace + listOffset;

For Index = 1 To NumEntries;

papiproc = pUserSpace + ApiOffsetexpsy;
ApiProc2 = *Blank;
apiproc2 = %Subst(apiproc : 1 : apilengthexpsy );

pEntry = pentry + ApiSizeOfEntry;

EndFor;

/end-free

Best regards,
Manuel


Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.