× 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 is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hans,

We've been using the single level /if not defined(....) for API programs.
The API's support multiple formats.  Most of them are the same with a few
fields added on.

Sample is the API QUSLMBR.  It supports the formats:  MBRL0100, MBRL0200,
MBRL0300, MBRL0310, MBRL0320, MBRL0330.  MBRL0200 has the same layout as
MBRL0100 with a few fields added.  MBRL0300 has the same format as
MBRL0200 with a few fields added...
So we create multiple members in our QAPISRC file.

Member MBRL0100 looks like:
      /If not defined(QUSLMBR)
      /Define QUSLMBR
      /Include ROUTINES/QAPISRC,QUSLMBR

      /EndIf
      /Define MBRL0100
      /If not defined(MBRL0200)
      * MBRL0100 - QUSLMBR - List Database File Members - Basic
Information
     D MBRL0100        DS
      /EndIf
     D  MLMbrName                    10a      Member name used

Member MBRL0200 looks like:
      /If not defined(QUSLMBR)
      /Define QUSLMBR
      /Include ROUTINES/QAPISRC,QUSLMBR

      /EndIf
      /Define MBRL0200
      /If not defined(MBRL0300)
      * MBRL0200 - QUSLMBR - List Database File Members - Source info
     D MBRL0200        DS
      /EndIf
      /Include ROUTINES/QAPISRC,MBRL0100
     D  MLSourceType                 10a      Source type
     D  MLCreateTS                   13a      Create date & time
     D  MLSourceTS                   13a      Source change D & T
     D  MLText                       50a      Member text
     D  MLCCSID                      10i 0      Member text CCSID

The rub is that I didn't care for the documentation on 0310, 0320, 0330 so
I wanted 0300 to not put the DS line in there if any of those three were
described.

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin




Hans Boldt <boldt@ca.ibm.com>
Sent by: rpg400-l-admin@midrange.com
07/10/2002 12:07 PM
Please respond to rpg400-l


        To:     rpg400-l@midrange.com
        cc:
        Fax to:
        Subject:        Re: Conditional compilation directives:  Is AND valid?


rob@dekko.com wrote:
> Can I do the following?  If not, then now do you recommend forming the
if
> nest?
>
>       /If not defined(MBRL0310) AND not defined(MBRL0320) AND not
> defined(MBRL0330)
>       * MBRL0300 - QUSLMBR - List Database File Members - Source info
>      D MBRL0300        DS
>       /EndIf

No, you can't code any operators on a /IF directive.

Also, you might want to rethink what you're doing since I suspect
you're trying to do something that's not possible in RPG IV.  When
you code "/IF DEFINED(X)", for the condition to be considered true,
the name X is a name specified either in the DEFINE parameter on the
CRTRPGMOD/CRTBNDRPG command or on the /DEFINE directive.  It does
not refer to any names coded otherwise in the RPG program, and
cannot be used to condition code whether or not a specific variable
name is defined.

(Also, you can also code something like "/IF DEFINED(*V5R1M0)" to
conditionally compile code intended for the specified release or later.)

Cheers!  Hans






_______________________________________________
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-Ups:

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.