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



>From: Smith, Nelson [mailto:NSmith@lincare.com]
>Sent: Tuesday, February 19, 2002 2:32 PM
>
>I'm having trouble converting my trigger programs over to using prototypes
>rather than a PLIST.
>
>How do you specify the first parameter for a trigger in a prototype?  If I
>use an asterisk for a pointer,  how do I define the datastructure to start
>at that pointer location?   Since the second parameter gives us the size
of
>the first parameter, can that be used to declare the size of the first
>parameter?

Nelson, declare the data structure as based, and set the basing pointer
to the address of the first parameter.

D trigBuf         ds             based(pTrigBuf)
D   ...
D   oldRcdOffset ...
D   ...
D   newRcdOffset ...

 * Declare the trigBufParm as 1a, to avoid any inadvertent
 * changing of it
D trigpgm         pi
D   trigBufParm            1a
D   trigBufLen            10i 0  const

c          eval      pTrigBuf = %addr(trigBufParm)

Within the structure for the first parameter, you should only be
declaring the first 80 or so bytes.  The record areas should be
declared separately as based data structures, and their basing
pointers should be set using the offsets in the first parameter.

D inRecord    e ds           based(pInRecord)
D                            extname(myfile) prefix(in)
D outRecord   e ds           based(pInRecord)
D                            extname(myfile) prefix(out)

c          eval      pInRecord = %addr(trigbuf) + oldRcdOffset
c          eval      pOutRecord = %addr(trigbuf) + newRcdOffset

In V5R1, you could declare the parameter as a data structure
directly:

D trigBufType   ds           qualified based(dummy)
D   subfields ...

D trigpgm       pi
D   trigBuf                  likeds(trigBufType)
D   triglen           10i 0  const

c          eval      pInRecord = %addr(trigbuf)
c                              + trigbuf.oldRcdOffset
c          eval      pOutRecord = %addr(trigbuf)
c                               + trigbuf.newRcdOffset

Barbara Morris



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.