os/2 vx and Object Rexx - REXX

This is a discussion on os/2 vx and Object Rexx - REXX ; Hi all I thought I would share is problem with one and all, starting with the problem. One creates a new VXRExx project, and under section you add a file with Object Rexx classes and method, all with correct formating ...

+ Reply to Thread
Results 1 to 4 of 4

os/2 vx and Object Rexx

  1. Default os/2 vx and Object Rexx

    Hi all

    I thought I would share is problem with one and all, starting with the
    problem. One creates a new VXRExx project, and under section you add a
    file with Object Rexx classes and method, all with correct formating
    and returns, then say add some code to a button, which initiates these,
    you run it, and all is well. Then you make the exe file and run that,
    wow panic, "cannot load window" error comes up what the heck is going
    on, "someone go call Hanna...."

    although I have lost the book "Object REXX for OS/2 Rexx Bytes Objects
    Now or Taking the "Oh, oh!" out of OO I still had the cd that came
    with the book, as well as the book in pdf, what I could not understand
    is why the application from the book ran, even if they included Object
    Rexx code..., where mine did not, even though they both
    seemed the same. I have solved this riddle, and this means I have
    hit a dead end now, OK I'll explain, normally when one creates a vxrexx
    project the code produced is auto written to en exe file containing, I
    assume all the resource stuff window definition files icons etc

    so back to this entry in main section one find this:

    _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    _VREPrimaryWindow =VRLoad( parent, _VREPrimaryWindowPath )
    say "pid=" _VREPrimaryWindow " window= " _VREPrimaryWindowPath

    returns this in the ditor
    pid = ?VRAB8810 of window = F:\__tmp1\oosample.VRW window location

    and this from the exe file:

    pid = VRA48810 window = F:\testbed\rexx\two\oosample.VRW location, which
    does not exist, but must be in the exe file, I assume.

    however once one places a section containing '::' either a required
    statement, or class definition and methods the window fails to load
    thus VREPrimaryWindow returns "" a null string and
    _VREPrimaryWindowPath = F:\testbed\rexx\two\oosample.VRW

    So I opened one of the sample progs from the book and saved it to a new
    location, made a new exe file and ran it, simply got the same error as
    my attempts, why, because they included the *.VRW file in the same
    directory as the program file!
    So the program could not load it when it was not present! In other
    words the sample programs have the same problems as mine, so they
    cheeted by including the *.VRW file in the same directory. The exe file
    should be independent, except for it need for Vrobj.dll,.

    Hence my experiment of changing
    _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW" to
    _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRY" worked
    because the file contained the window definition file existed. One
    solution might be to include the *.wrw file!

    The question is this, is the stuff in the exe file and cannot be
    executed because of the '::', or maybe it does not get written
    correctly? The file size does increase from 18 681b to 20 681 when the
    class file is included

    Oh well, I will keep on working at it, any hint anyone

    regards

    Adrian

  2. Default Re: os/2 vx and Object Rexx

    IIRC (and it's a long time), the main program created by VX-Rexx is missing
    an END. The old interpreter didn't care as such, but OO-REXX barks. You need
    to insert the missing END by hand.

    "adrian suri" <asuri@tele2.se> wrote in message
    news:4WVkf.24$xg.82@nntpserver.swip.net...
    > Hi all
    >
    > I thought I would share is problem with one and all, starting with the
    > problem. One creates a new VXRExx project, and under section you add a
    > file with Object Rexx classes and method, all with correct formating
    > and returns, then say add some code to a button, which initiates these,
    > you run it, and all is well. Then you make the exe file and run that,
    > wow panic, "cannot load window" error comes up what the heck is going
    > on, "someone go call Hanna...."
    >
    > although I have lost the book "Object REXX for OS/2 Rexx Bytes Objects
    > Now or Taking the "Oh, oh!" out of OO I still had the cd that came
    > with the book, as well as the book in pdf, what I could not understand
    > is why the application from the book ran, even if they included Object
    > Rexx code..., where mine did not, even though they both
    > seemed the same. I have solved this riddle, and this means I have
    > hit a dead end now, OK I'll explain, normally when one creates a vxrexx
    > project the code produced is auto written to en exe file containing, I
    > assume all the resource stuff window definition files icons etc
    >
    > so back to this entry in main section one find this:
    >
    > _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    > _VREPrimaryWindow =VRLoad( parent, _VREPrimaryWindowPath )
    > say "pid=" _VREPrimaryWindow " window= " _VREPrimaryWindowPath
    >
    > returns this in the ditor
    > pid = ?VRAB8810 of window = F:\__tmp1\oosample.VRW window location
    >
    > and this from the exe file:
    >
    > pid = VRA48810 window = F:\testbed\rexx\two\oosample.VRW location, which
    > does not exist, but must be in the exe file, I assume.
    >
    > however once one places a section containing '::' either a required
    > statement, or class definition and methods the window fails to load
    > thus VREPrimaryWindow returns "" a null string and
    > _VREPrimaryWindowPath = F:\testbed\rexx\two\oosample.VRW
    >
    > So I opened one of the sample progs from the book and saved it to a new
    > location, made a new exe file and ran it, simply got the same error as
    > my attempts, why, because they included the *.VRW file in the same
    > directory as the program file!
    > So the program could not load it when it was not present! In other
    > words the sample programs have the same problems as mine, so they
    > cheeted by including the *.VRW file in the same directory. The exe file
    > should be independent, except for it need for Vrobj.dll,.
    >
    > Hence my experiment of changing
    > _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW" to
    > _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRY" worked
    > because the file contained the window definition file existed. One
    > solution might be to include the *.wrw file!
    >
    > The question is this, is the stuff in the exe file and cannot be
    > executed because of the '::', or maybe it does not get written
    > correctly? The file size does increase from 18 681b to 20 681 when the
    > class file is included
    >
    > Oh well, I will keep on working at it, any hint anyone
    >
    > regards
    >
    > Adrian




  3. Default Re: os/2 vx and Object Rexx

    Hi Mark

    In this case I am not sure that it's as simple as a simple missing end
    statement, the program ie the exe file runs fine, as does the projects
    until it has a section which includes some Object Rexx classes and
    methods, all I would add rith correct return statements.

    This is where it seems to be going wrong

    _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    _VREPrimaryWindow=VRLoad( parent, _VREPrimaryWindowPath )
    say _VREPrimaryWindow
    drop parent spec

    with no onject rexx class' and methods the say returns a PID of the
    window, and with object rexx code, in the editor does the same, as soon
    as one makes an exe it no longer runs and the say reurns nul

    regards

    Adrian


    > IIRC (and it's a long time), the main program created by VX-Rexx is missing
    > an END. The old interpreter didn't care as such, but OO-REXX barks. You need
    > to insert the missing END by hand.
    >
    > "adrian suri" <asuri@tele2.se> wrote in message
    > news:4WVkf.24$xg.82@nntpserver.swip.net...
    >
    >>Hi all
    >>
    >>I thought I would share is problem with one and all, starting with the
    >>problem. One creates a new VXRExx project, and under section you add a
    >>file with Object Rexx classes and method, all with correct formating
    >>and returns, then say add some code to a button, which initiates these,
    >>you run it, and all is well. Then you make the exe file and run that,
    >>wow panic, "cannot load window" error comes up what the heck is going
    >>on, "someone go call Hanna...."
    >>
    >>although I have lost the book "Object REXX for OS/2 Rexx Bytes Objects
    >>Now or Taking the "Oh, oh!" out of OO I still had the cd that came
    >>with the book, as well as the book in pdf, what I could not understand
    >>is why the application from the book ran, even if they included Object
    >>Rexx code..., where mine did not, even though they both
    >>seemed the same. I have solved this riddle, and this means I have
    >>hit a dead end now, OK I'll explain, normally when one creates a vxrexx
    >>project the code produced is auto written to en exe file containing, I
    >>assume all the resource stuff window definition files icons etc
    >>
    >>so back to this entry in main section one find this:
    >>
    >>_VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    >> _VREPrimaryWindow =VRLoad( parent, _VREPrimaryWindowPath )
    >>say "pid=" _VREPrimaryWindow " window= " _VREPrimaryWindowPath
    >>
    >>returns this in the ditor
    >>pid = ?VRAB8810 of window = F:\__tmp1\oosample.VRW window location
    >>
    >>and this from the exe file:
    >>
    >>pid = VRA48810 window = F:\testbed\rexx\two\oosample.VRW location, which
    >>does not exist, but must be in the exe file, I assume.
    >>
    >>however once one places a section containing '::' either a required
    >>statement, or class definition and methods the window fails to load
    >>thus VREPrimaryWindow returns "" a null string and
    >>_VREPrimaryWindowPath = F:\testbed\rexx\two\oosample.VRW
    >>
    >>So I opened one of the sample progs from the book and saved it to a new
    >>location, made a new exe file and ran it, simply got the same error as
    >>my attempts, why, because they included the *.VRW file in the same
    >>directory as the program file!
    >>So the program could not load it when it was not present! In other
    >>words the sample programs have the same problems as mine, so they
    >>cheeted by including the *.VRW file in the same directory. The exe file
    >>should be independent, except for it need for Vrobj.dll,.
    >>
    >>Hence my experiment of changing
    >>_VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW" to
    >>_VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRY" worked
    >>because the file contained the window definition file existed. One
    >>solution might be to include the *.wrw file!
    >>
    >>The question is this, is the stuff in the exe file and cannot be
    >>executed because of the '::', or maybe it does not get written
    >>correctly? The file size does increase from 18 681b to 20 681 when the
    >>class file is included
    >>
    >>Oh well, I will keep on working at it, any hint anyone
    >>
    >>regards
    >>
    >>Adrian

    >
    >
    >



    /*:VRX */
    /* Main */
    Main:
    /* Process the arguments.
    Get the parent window.
    */
    parse source os calledAs other
    parent = ""
    argCount = arg()
    argOff = 0
    if( calledAs \= "COMMAND" )then do
    if argCount >= 1 then do
    parent = arg(1)
    argCount = argCount - 1
    argOff = 1
    end
    end
    else do
    call VROptions 'ImplicitNames'
    call VROptions 'NoEchoQuit'
    end
    if( argCount > 0 )then do i = 1 to argCount
    InitArgs.i = arg( i + argOff )
    end
    CalledWith=InitArgs.1
    drop calledAs argCount argOff

    /* Load the windows
    */
    OK=VRInit()
    parse source os calledAs spec
    _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    _VREPrimaryWindow=VRLoad( parent, _VREPrimaryWindowPath )
    say _VREPrimaryWindow
    drop parent spec
    if( _VREPrimaryWindow == "" )then do
    call VRMessage "", "Cannot load window:" VRError(), "Error!"
    _VREReturnValue = 32000
    signal _VRELeaveMain
    end

    /* Process events
    */
    call Init
    signal on halt
    do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
    _VREEvent = VREvent()
    interpret _VREEvent
    end
    _VREHalt:
    _VREReturnValue = Fini()
    call VRDestroy _VREPrimaryWindow
    _VRELeaveMain:
    call VRFini
    exit _VREReturnValue

    VRLoadSecondary:
    __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
    if __vrlsWait then do
    call VRFlush
    end
    __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
    if __vrlsHWnd = '' then signal __vrlsDone
    if __vrlsWait \= 1 then signal __vrlsDone
    call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
    __vrlsTmp = __vrlsWindows.0
    if( DataType(__vrlsTmp) \= 'NUM' ) then do
    __vrlsTmp = 1
    end
    else do
    __vrlsTmp = __vrlsTmp + 1
    end
    __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
    __vrlsWindows.0 = __vrlsTmp

    do while( VRIsValidObject( VRWindow() ) = 1 )
    __vrlsEvent = VREvent()
    interpret __vrlsEvent
    end
    __vrlsTmp = __vrlsWindows.0
    __vrlsWindows.0 = __vrlsTmp - 1
    call VRWindow __vrlsWindows.__vrlsTmp
    __vrlsHWnd = ''
    __vrlsDone:
    return __vrlsHWnd



  4. Default Re: os/2 vx and Object Rexx

    As I said, it's been a long time; however it looks awfully familiar to me as
    the missing END problem. Before going crazy, correct the missing END.

    "adrian suri" <asuri@tele2.se> wrote in message
    news:J3enf.2150$xg.1183@nntpserver.swip.net...
    > Hi Mark
    >
    > In this case I am not sure that it's as simple as a simple missing end
    > statement, the program ie the exe file runs fine, as does the projects
    > until it has a section which includes some Object Rexx classes and
    > methods, all I would add rith correct return statements.
    >
    > This is where it seems to be going wrong
    >
    > _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    > _VREPrimaryWindow=VRLoad( parent, _VREPrimaryWindowPath )
    > say _VREPrimaryWindow
    > drop parent spec
    >
    > with no onject rexx class' and methods the say returns a PID of the
    > window, and with object rexx code, in the editor does the same, as soon
    > as one makes an exe it no longer runs and the say reurns nul
    >
    > regards
    >
    > Adrian
    >
    >
    >> IIRC (and it's a long time), the main program created by VX-Rexx is
    >> missing
    >> an END. The old interpreter didn't care as such, but OO-REXX barks. You
    >> need
    >> to insert the missing END by hand.
    >>
    >> "adrian suri" <asuri@tele2.se> wrote in message
    >> news:4WVkf.24$xg.82@nntpserver.swip.net...
    >>
    >>>Hi all
    >>>
    >>>I thought I would share is problem with one and all, starting with the
    >>>problem. One creates a new VXRExx project, and under section you add a
    >>>file with Object Rexx classes and method, all with correct formating
    >>>and returns, then say add some code to a button, which initiates these,
    >>>you run it, and all is well. Then you make the exe file and run that,
    >>>wow panic, "cannot load window" error comes up what the heck is going
    >>>on, "someone go call Hanna...."
    >>>
    >>>although I have lost the book "Object REXX for OS/2 Rexx Bytes Objects
    >>>Now or Taking the "Oh, oh!" out of OO I still had the cd that came
    >>>with the book, as well as the book in pdf, what I could not understand
    >>>is why the application from the book ran, even if they included Object
    >>>Rexx code..., where mine did not, even though they both
    >>>seemed the same. I have solved this riddle, and this means I have
    >>>hit a dead end now, OK I'll explain, normally when one creates a vxrexx
    >>>project the code produced is auto written to en exe file containing, I
    >>>assume all the resource stuff window definition files icons etc
    >>>
    >>>so back to this entry in main section one find this:
    >>>
    >>>_VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    >>> _VREPrimaryWindow =VRLoad( parent, _VREPrimaryWindowPath )
    >>>say "pid=" _VREPrimaryWindow " window= " _VREPrimaryWindowPath
    >>>
    >>>returns this in the ditor
    >>>pid = ?VRAB8810 of window = F:\__tmp1\oosample.VRW window location
    >>>
    >>>and this from the exe file:
    >>>
    >>>pid = VRA48810 window = F:\testbed\rexx\two\oosample.VRW location, which
    >>>does not exist, but must be in the exe file, I assume.
    >>>
    >>>however once one places a section containing '::' either a required
    >>>statement, or class definition and methods the window fails to load
    >>>thus VREPrimaryWindow returns "" a null string and
    >>>_VREPrimaryWindowPath = F:\testbed\rexx\two\oosample.VRW
    >>>
    >>>So I opened one of the sample progs from the book and saved it to a new
    >>>location, made a new exe file and ran it, simply got the same error as
    >>>my attempts, why, because they included the *.VRW file in the same
    >>>directory as the program file!
    >>>So the program could not load it when it was not present! In other
    >>>words the sample programs have the same problems as mine, so they
    >>>cheeted by including the *.VRW file in the same directory. The exe file
    >>>should be independent, except for it need for Vrobj.dll,.
    >>>
    >>>Hence my experiment of changing
    >>>_VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW" to
    >>>_VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRY" worked
    >>>because the file contained the window definition file existed. One
    >>>solution might be to include the *.wrw file!
    >>>
    >>>The question is this, is the stuff in the exe file and cannot be
    >>>executed because of the '::', or maybe it does not get written
    >>>correctly? The file size does increase from 18 681b to 20 681 when the
    >>>class file is included
    >>>
    >>>Oh well, I will keep on working at it, any hint anyone
    >>>
    >>>regards
    >>>
    >>>Adrian

    >>
    >>
    >>

    >
    >



    --------------------------------------------------------------------------------


    > /*:VRX */
    > /* Main */
    > Main:
    > /* Process the arguments.
    > Get the parent window.
    > */
    > parse source os calledAs other
    > parent = ""
    > argCount = arg()
    > argOff = 0
    > if( calledAs \= "COMMAND" )then do
    > if argCount >= 1 then do
    > parent = arg(1)
    > argCount = argCount - 1
    > argOff = 1
    > end
    > end
    > else do
    > call VROptions 'ImplicitNames'
    > call VROptions 'NoEchoQuit'
    > end
    > if( argCount > 0 )then do i = 1 to argCount
    > InitArgs.i = arg( i + argOff )
    > end
    > CalledWith=InitArgs.1
    > drop calledAs argCount argOff
    >
    > /* Load the windows
    > */
    > OK=VRInit()
    > parse source os calledAs spec
    > _VREPrimaryWindowPath = VRParseFileName( spec, "dpn" ) || ".VRW"
    > _VREPrimaryWindow=VRLoad( parent, _VREPrimaryWindowPath )
    > say _VREPrimaryWindow
    > drop parent spec
    > if( _VREPrimaryWindow == "" )then do
    > call VRMessage "", "Cannot load window:" VRError(), "Error!"
    > _VREReturnValue = 32000
    > signal _VRELeaveMain
    > end
    >
    > /* Process events
    > */
    > call Init
    > signal on halt
    > do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
    > _VREEvent = VREvent()
    > interpret _VREEvent
    > end
    > _VREHalt:
    > _VREReturnValue = Fini()
    > call VRDestroy _VREPrimaryWindow
    > _VRELeaveMain:
    > call VRFini
    > exit _VREReturnValue
    >
    > VRLoadSecondary:
    > __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
    > if __vrlsWait then do
    > call VRFlush
    > end
    > __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
    > if __vrlsHWnd = '' then signal __vrlsDone
    > if __vrlsWait \= 1 then signal __vrlsDone
    > call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
    > __vrlsTmp = __vrlsWindows.0
    > if( DataType(__vrlsTmp) \= 'NUM' ) then do
    > __vrlsTmp = 1
    > end
    > else do
    > __vrlsTmp = __vrlsTmp + 1
    > end
    > __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
    > __vrlsWindows.0 = __vrlsTmp
    >
    > do while( VRIsValidObject( VRWindow() ) = 1 )
    > __vrlsEvent = VREvent()
    > interpret __vrlsEvent
    > end
    > __vrlsTmp = __vrlsWindows.0
    > __vrlsWindows.0 = __vrlsTmp - 1
    > call VRWindow __vrlsWindows.__vrlsTmp
    > __vrlsHWnd = ''
    > __vrlsDone:
    > return __vrlsHWnd
    >
    >




+ Reply to Thread

Similar Threads

  1. IBM Object REXX plus ooRexx
    By Application Development in forum REXX
    Replies: 10
    Last Post: 01-11-2008, 06:28 AM
  2. Trying to find IBM Object Rexx
    By Application Development in forum REXX
    Replies: 8
    Last Post: 12-19-2006, 06:59 AM
  3. FTP with Object Rexx
    By Application Development in forum REXX
    Replies: 3
    Last Post: 05-06-2006, 12:57 PM
  4. Re: Object REXX and FP5
    By Application Development in forum REXX
    Replies: 1
    Last Post: 07-20-2005, 11:53 PM
  5. Running Object Rexx rexx.exe as a NT Service
    By Application Development in forum REXX
    Replies: 3
    Last Post: 01-14-2005, 05:01 AM