I would like to thank everybody who responded with comments and suggestions.

I am going to follow Rick's suggestion of the "dynamic loading"...

It fits the overall project the best.

/s/ Bill Turner, wb4alm


On 4/4/21 2:32 PM, Rick McGuire wrote:
The Package class has a loadPackage() method that is a dynamic version of ::REQUIRES. Just use

.context~package~loadPackage('winsys.cls')

in your prolog code to add the package to your context if you're on Windows.

Rick


On Sun, Apr 4, 2021 at 12:57 PM Bill Turner, WB4ALM <wb4...@arrl.net <mailto:wb4...@arrl.net>> wrote:

    I have a routine that functions under LINUX or under WINDOWS.

    It has additional functionality under WINDOWS, that needs a
          ::REQUIRES "winsystm.cls"
    statement.

    Obviously, that is not installed on a LINUX based system so it
    causes an
    error
    that the ".cls" can not be found.

    I do not want to maintain two different copies of the same ooRexx
    script and
    I use the PARSE SOURCE instruction to determine the current
    operating system
    and save this value for testing later in the program.

    Is there a way to
    (1) conditionally control the execution of the ::REQUIRES statement or
    (2) Trap that specific error so that t can be ignored?

    /s/ Bill Turner, wb4alm


    _______________________________________________
    Oorexx-devel mailing list
    Oorexx-devel@lists.sourceforge.net
    <mailto:Oorexx-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/oorexx-devel
    <https://lists.sourceforge.net/lists/listinfo/oorexx-devel>


_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to