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



This would require the use of one of the following:
1)  The use of different field names in the data structures.  Trying to
avoid that.
2)  The use of the PREFIX keyword.  Not popular with the developers.
Searching for XXfld1 won't find where it is defined.  They would prefer
option 1.
3)  Use of the qualified keyword.  While more self documenting that the
prefix, still leaves a bitter taste for, let's say our more 'seasoned'
staff.


Rob Berendt

==================
A smart person learns from their mistakes,
but a wise person learns from OTHER peoples mistakes.



                    "Bob Cozzi
                    \(RPGIV\)"              To:     <rpg400-l@midrange.com>
                    <cozzi@rpgiv.com>       cc:
                    Sent by:                Fax to:
                    rpg400-l-admin@mi       Subject:     RE: Stacking data 
structures
                    drange.com


                    09/18/2001 01:17
                    PM
                    Please respond to
                    rpg400-l






You can't take the address of a variable that also has the BASED keyword
specified. By definition, Based means that the variable has no storage.
That is, it is simply a viewport to the data at the location (what ever
location) that is specified in the based-on pointer variable.

You should create the biggest data structure you'll need, and then you
can assign that data structure's address to a pointer variable. The
other data structures can be BASED on that same pointer, but the pointer
should be set to the %ADDR of the biggest one.

Bob Cozzi
cozzi@rpgiv.com
Visit the new on-line iSeries Forums at: http://www.rpgiv.com/forum

> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On
> Behalf Of rob@dekko.com
> Sent: Tuesday, September 18, 2001 10:28 AM
> To: rpg400-l@midrange.com
> Subject: Stacking data structures
>
>
> Because of the many possible formats you can use on some of the list
API's
> we thought of stacking data structures.  Below is a sample:
>
>       * OBJL0100 - QUSLOBJ - List Objects - Object names
>      D pOBJL0100       S               *   Inz(%addr(OBJL0100D))
> Ptr object list
>      D OBJL0100        DS                  Based(pOBJL0100)
>      D  OLObjNam                     10A
> Object name
>      D  OLObjLib                     10A
> Object library
>      D  OLObjTyp                     10A
> Object type
>
>       * OBJL0200 - QUSLOBJ - List Objects - Text description and
extended
> attribute
>      D pOBJL0200       S               *   Inz(%addr(OBJL0200D))
> Ptr object list
>      D OBJL0200        DS                  Based(pOBJL0200)
>      D  OBJL0100D                          Like(OBJL0100)
>      D  OLObjSts                      1A
> Object status
>      D  OLExtAtr                     10A
> Extended attribute
>      D  OLTxtDsc                     50A
> Text description
>      D  OLDefAtr                     10A
> User defined atr
>      D  OLRes1                        7A
> Reserved
>
>       * OBJL0300 - QUSLOBJ - List Objects - Basic object information
>      D pOBJL0300       S               *
>      D OBJL0300        DS                  Based(pOBJL0300)
>      D  OBJL0200D                          Like(OBJL0200)
>      D  OLAuxSP                      10I 0
> Aux storage pool
>      D  OLObjOwn                     10A
> Object owner
>      D  OLObjDom                      2A
> Object domain
>      D  OLCrtDat                      8A
> Create date/time
>      D  OLChgDat                      8A
> Change date/time
>      D  OLStorage                    10A
> Storage
>      D  OLCmprSts                     1A
> Compression status
>      D  OLAlwChg                      1A
> Allow program change
>      D  OLAudVal                     10A
> Auditing value
>      D  OLRes2                        9A
> Reserved
>
> But, when we compile this we get
>  Msg id  Sv Number Seq     Message text
> *RNF0314 20      7 000200+ Built-in function %ADDR(OBJL0100D) does not
have
> a value
>                            known at compile-time; built-in function is
> ignored.
> *RNF0314 20     14 000900+ Built-in function %ADDR(OBJL0200D) does not
have
> a value
>                            known at compile-time; built-in function is
> ignored.
>
> So we tried to cheat and changed a few lines:
>      D pOBJL0300       S               *
> became
>      D pOBJL0300       S               *   Inz(%addr(OBJL0300P))
> Ptr object list
> and we added
>      D OBJL0300P       S              1A
> and got the same results.
>
> I)  Should I try reporting this as a bug?
> II)  Any suggested workarounds?
>
>
> Rob Berendt
>
> ==================
> A smart person learns from their mistakes,
> but a wise person learns from OTHER peoples mistakes.
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.







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.