|
On Wed, 26 Mar 2003, William A.(Tony) Corbett wrote:
>
> I currently need to be able, from within an RPG program, to retrieve the
> 'text' (description) from an RPG program via the name of that rpg program
> (taken from a report splf attributes).
>
Hi,
Here's an example of getting the program's text via API call... I hacked
this code out of a larger program of mine, but I did compile and run it,
and it works.
You may want to change the way it does error handling, though...
D dsEC DS
D dsECBytesP 10I 0 INZ(%size(dsEC))
D dsECBytesA 10I 0 INZ(0)
D dsECMsgID 7A
D dsECReserv 1A
D dsECMsgDta 240A
D QUSROBJD PR ExtPgm('QUSROBJD')
D RcvVar 32766A options(*varsize)
D RcvVarLen 10I 0 const
D Format 8A const
D QualObj 20A const
D ObjType 10A const
D ErrorCode 32766A options(*varsize)
D dsObjD DS
D dsObjD_BytRtn 10I 0
D dsObjD_BytAvl 10I 0
D dsObjD_ObjNam 10A
D dsObjD_ObjLib 10A
D dsObjD_ObjTyp 10A
D dsObjD_RtnLib 10A
D dsObjD_AuxStg 10I 0
D dsObjD_ObjOwn 10A
D dsObjD_ObjDmn 2A
D dsObjD_CrtDat 13A
D dsObjD_ChgDat 13A
D dsObjD_ExtAtr 10A
D dsObjD_Text 50A
D dsObjD_SrcFil 10A
D dsObjD_SrcLib 10A
D dsObjD_SrcMbr 10A
D peObject s 10A
D peLibrary s 10A
D peObjType s 10A
D peText s 50A
c *entry plist
c parm peObject
c parm peLibrary
c parm peObjType
c parm peText
* setting this to zero means that the API will send us
* an escape message if there's an error:
c eval dsECBytesP = 0
* Get object description
c callp QUSROBJD(dsObjD: %size(dsObjD):
c 'OBJD0200':
c peObject + peLibrary:
c peObjType:
c dsEC)
c eval peText = dsObjd_Text
c eval *inlr = *On
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.