#1010 ::REQUIRES doesn't search Windows path

closed
None
5
2012-08-14
2011-05-28
LesK
No

ooRexx 4.1.0 32 bit on 64 bit Windows 7.

I'm using THE editor and a macro (run.the) that saves a copy of the file
being editted in the C:\THE\ folder as a 'temp.the' file and then executes it as a macro.

I've used this technique for years to develop and test ooRexx/OLE
code for Excel, with ::REQUIRES for files in the SAME folder.

I do the same thing for the sample 'usepipe.rex', I get the error:

129 - ::REQUIRES 'pipe.rex'
Error 43 running C:\THE__tmprun.the line 129: Routine not
found
Error 43.901: Could not find routine "pipe.rex" for
::REQUIRES

The Windows PATH setting does include the samples folder, so
it appears that ::REQUIRES processing is not searching the PATH,
which it is documented to do.

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2011-05-29

    Hi Les,

    Some simple experimentation shows that the PATH is searched for the ::requires directive. So, I think the THE process you are operating in does not have the PATH value you think it does.

    Take this program:

    / Simple User Dialog template/

    dlg = .SimpleDialog~new
    dlg~execute("SHOWTOP", IDI_DLG_OOREXX)
    say "Executed dialog in __tmprun.the, leaving program."

    ::requires "ooDialog.cls"
    --::requires "pipe.rex"

    ::class 'SimpleDialog' subclass UserDialog

    ::method init
    forward class (super) continue

    self~create(30, 30, 257, 123, "Simple Dialog", "CENTER")

    ::method defineDialog

    self~createPushButton(IDOK, 142, 99, 50, 14, "DEFAULT", "Ok")
    self~createPushButton(IDCANCEL, 197, 99, 50, 14, , "Cancel")

    Name it __tmprun.the, put it in a directory named C:\THE, and run it. It runs fine, the dialog would not start up if Rexx couldn't find ooDialog.cls:

    Microsoft Windows [Version 5.2.3790]
    (C) Copyright 1985-2003 Microsoft Corp.

    C:>cd THE

    C:\THE>rexx tmprun.the
    Executed dialog in
    tmprun.the, leaving program.

    C:\THE>

    Now try it again after uncommenting the requires for pipe.rex:

    C:\THE>rexx __tmprun.the
    8 - ::requires "pipe.rex"
    Error 43 running C:\THE__tmprun.the line 8: Routine not found
    Error 43.901: Could not find routine "pipe.rex" for ::REQUIRES

    C:\THE>

    pipe.rex is in the samples subdirectory of the install, which is not in my path. pipe.rex is not found, which is to be expected.

    Now add the directory for pipe.rex to my path and try again:

    C:\THE>set PATH=%PATH%;C:\Rexx\ooRexx\samples

    C:\THE>rexx tmprun.the
    Executed dialog in
    tmprun.the, leaving program.

    C:\THE>

    It runs fine, showing that the path is indeed searched for the requires directive.

    You could try putting these lines in a simple macro that you run in the same way as your failing program to check what the PATH actually is when the macro is executing. I suspect it will not be what you think it is.

    say
    curPath = value("PATH", , 'ENVIRONMENT')
    say "The current path is:"
    say curPath
    say

    C:\THE>rexx __tmprun.the

    The current path is:
    C:\bin;C:\bin\GnuWin32\bin;C:\Tools\se\SlickEdit.v16.0.0.6\win\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System
    32\Wbem;C:\Tools\Subversion;C:\Tools\misc.dev.tools\Nsis;C:\Tools\misc.dev.tools\ResEdit;C:\work.ooRexx\xalan;C:
    \Program Files;C:\Programs\MySQL\MySQL.Server.5.1\bin;C:\Utils\TortoiseSVN\bin;C:\Tools\Subversion\bin\;%CommonP
    rogramFiles%\Microsoft Shared\Windows Live;C:\Rexx\ooRexx

    Executed dialog in __tmprun.the, leaving program.

    C:\THE>

    In the above, no 'samples' directory in the path. Add it to the front of the path and execute again:

    C:\THE>set PATH=C:\Rexx\ooRexx\samples;%PATH%

    C:\THE>rexx __tmprun.the

    The current path is:
    C:\Rexx\ooRexx\samples;C:\bin;C:\bin\GnuWin32\bin;C:\Tools\se\SlickEdit.v16.0.0.6\win\;C:\WINDOWS\system32;C:\WI
    NDOWS;C:\WINDOWS\System32\Wbem;C:\Tools\Subversion;C:\Tools\misc.dev.tools\Nsis;C:\Tools\misc.dev.tools\ResEdit;
    C:\work.ooRexx\xalan;C:\Program Files;C:\Programs\MySQL\MySQL.Server.5.1\bin;C:\Utils\TortoiseSVN\bin;C:\Tools\S
    ubversion\bin\;%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Rexx\ooRexx

    Executed dialog in __tmprun.the, leaving program.

    C:\THE>

     
  • LesK

    LesK - 2011-05-29

    Hi Mark,
    This is TERRIBLY embarrassing! Despite the fact that I checked the Path from THE,
    from a command window and in Environment Variables multiple times, my weak
    eyes still missed a spelling error in the entry for Samples!! With that fixed, all is
    well. My sincere apologies for putting you through all this.

    I have no idea how I managed to create a a Duplicate of this. You would think that
    SF could protect us from that, however it happens.

     
  • Mark Miesfeld

    Mark Miesfeld - 2011-05-30

    No problem Les, I did a very similar thing a few weeks ago.

    As for duplicates, it happens pretty often. Not sure why.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks