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


  • Subject: Re: Trigger program input buffer layout
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Fri, 07 Jan 2000 16:19:54 -0800
  • Organization: Conex Global Logistics Services, Inc.

Scott,

I thought about doing it something like this, but how do
you know the Parm1 size before hand?  Or does it matter?

You are setting Parm1 up as 3072 bytes, how do you know
it is this size?  And does it matter?

I thought that if I specified a parameter larger than my actual
parameter I would get problems.  For instance, say I had
2 parameters I was passing as length 5 strings.  If I declared
them as length 10 in my program, wouldn't I actually get both
passed values in my first parameter?

Perhaps this is a good time to use the VARYING length
definition?

Regards,

Jim Langston

Scott Klement wrote:

> <SNIP>

> As far as a "better way to do it", the way that I usually handle
> triggers is that I make an externally defined data structure using
> the description of the file that the trigger is to be added to.
> Then, I base that data structure on a pointer, and I offset that
> pointer to the location that the record is stored in "Parm1"
>
> Something like this:
>
> D Parm1           DS
> D* Array, because I can't use pointer arthmetic at V3R2
> D  Buffer                 1   3072A   DIM(3072)
> D  FileName               1     10
> D  LibName               11     20
> D  MemName               21     30
> D  TrigEvent             31     31
> D  TrigTime              32     32
> D  CommLockLvl           33     33
> D  Reserved01            34     36
> D  CCSID                 37     40B 0
> D  Reserved02            41     48
> D  OldOffset             49     52B 0
> D  OldLength             53     56B 0
> D  OldByteMapOff         57     60B 0
> D  OldByteMapLen         61     64B 0
> D  NewOffset             65     68B 0
> D  NewLength             69     72B 0
> D  NewByteMapOff         73     76B 0
> D  NewByteMapLen         77     80B 0
> D  Reserved03            81     96
>
> D p_NewBuf        S               *
> D dsRecord      e ds                  EXTNAME(MYFILE)
> D                                     BASED(p_NewBuf)
>
> c                   eval      p_NewBuf = %addr(Buffer(NewOffset+1))
>
> If your release can use pointer arithmetic directly, you could
> (instead of using the array) just add the "newoffset" to the
> address of Parm1 to get p_NewBuf instead of using the array method
> that I used above...

<SNIP>

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 thread ...

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.