PipeBridge Modification attempt
The rebol and arexx source that is different than in PipeBridge.lha follows.

"rex.r" replaces "rexx.r" AND "strings.r" in the archive and PipeBridge.rexx only has one small change noted. You'll still need "StopBridge.rexx" in the archive. You'll want the originals in the event things get fixed in the next version of rebol.

I reformatted the rebol code also for my own readability. Let me know what you think about the format and/or other rebol code formating. Apparently the format is very flexiable. Email Tim Rue

*** Perhaps what is needed for this to really work is a way for the temp files being receive by rex.r, from pipebridge.rexx, to be given unique names by rex.r? If you do this, LET ME KNOW and I'll update my pages to reflect it.


Former headers of the following rex.r rebol codes.

REBOL [
    Title:      "Rexx Bridge"
    Author:     "Simon Edwards"
    Email:      sbe@worldonline.nl
    Date:       9-Oct-1998
    File:       %rexx.r
    Purpose:    "Provides access to Amiga Arexx ports"
]

REBOL [
    Title:      "String utils"
    Author:     "Simon Edwards"
    Email:      sbe@worldonline.nl
    Date:       9-Oct-1998
    File:       %string.r
    Purpose:    "Some simple string utility functions."
]


-------------->8------------begin cut line--------------------------------

REBOL [
    Title:      "Rexx Bridge and Strings"
    Author:     Originals By Simon Edwards - Modified By Tim Rue
    Email:      sbe@worldonline.nl - timrue@mindspring.co
    Date:       11-Oct-1998
    File:       %rex.r
    Purpose:    "Combine rexx.r and strings.r together AND"
    Purpose:    "Provides access to Amiga Arexx ports"
]


to-string: make function!
    [value]
    [if string? :value
        [return :value]
     else
        [return mold :value]
    ]

append: make function!
    [series value]
    [insert tail series value series]

concat: make function!
    [series]
    [use
        [temp part realpart cooked]
        [cooked: reduce :series temp: make string! "" foreach part cooked
            [if number? part
                [realpart: to-string part]
             else
                [realpart: part]
             append temp realpart
            ]
         temp
        ]
    ]

;;;-------the above is from strings.r --- below from rexx.r ----

use
    [hostport lastrc lastresult rexx-execute]
    [lastrc: 0

;;; Default to using AmigaDOS

     hostport: "COMMAND"
     lastresult: ""


;;;
;;; Use this to set the current 'host' port. Much like Arexx's Address
;;; command.
;;;

     address: make function!
        [host]
        [hostport: :host]

;;;
;;; Internal function
;;;

     rexx-execute: make function!
        [command]
        [use
            [rexxresult]
            [save %"PIPE:fromrebol" reduce
                [hostport command]
;;;          if exists? %T:torebol
;;;             [delete %T:torebol]
             Rexx-wait
             delete %T:torebol
            ]
        ]

     Rexx-wait: make function!
        []
        [while
            [not exists? %T:torebol]
            [if exists? %T:torebol
                [rexxresult: load %T:torebol
                 rexxresult: load %T:torebol
                 print "got it"
                 lastrc: first :rexxresult
                 lastresult: second :rexxresult
                 print lastrc
                 print lastresult
;;;              delete %T:torebol
                 return :rexxresult
                ]
              else [print "Temp file not there yet, wait and watch"]
            ]
        ]

;;;
;;; Calls an Arexx port (kind of). This takes either a string or a block
;;; value. If a block is given, it is first reduced and turned into a string.
;;; The string is then send to the selected Arexx port via the PipeBridge.
;;; The Result string is returned.
;;;

     call: make function!
        [values]
        [use
            [command p cooked]
            [if string? :values
                [rexx-execute values]
             else
                [rexx-execute concat values]
             return lastresult
            ]
        ]

;;;
;;; Returns the return code from the last command.
;;; (The return value will probably be a string, not a number).
;;;

     rc: make function!
        []
        [return lastrc]

;;;
;;; Returns the Result string of the last command issued.
;;;

     result: make function!
        []
        [return lastresult]

    ]
------------8<-------end cut line-----------------------

------------>8-------begin cut line----------------------- /* filename = PipeBridge.rexx PipeBridge v1.0 - with one small element changed by Tim Rue By Simon Edwards Email: sbe@worldonline.nl Bridge Rebol<->Arexx Ports using an AmigaDOS PIPE:! */ options results say say "Pipe Bridge" say say "By Simon Edwards " say do forever say say "Opening PIPE:fromrebol" call open('source', 'PIPE:fromrebol', 'R') say "Waiting." do forever rebolblock = readln('source') say "Reading." if rebolblock ~= "" | eof('source') then break end if rebolblock = "" then break call close('source') say "Closing PIPE:fromrebol" parse var rebolblock '["' destport '" "' commandstring '"]' if destport = 'QUITBRIDGE' then do say "*** Stopping." exit end say say "Request" say "Port : " destport say "Command : " commandstring say say "Executing" if destport = 'COMMAND' then do /* AmigaDOS call. */ address COMMAND failat 21 commandstring rebolrc = rc rebolresult = result failat 10 end else do /* Normal Arexx port */ if show('p',destport) then do address value destport failat 21 commandstring rebolrc = rc rebolresult = result failat 10 end else do rebolrc = 20 rebolresult = "Host environment not found" end end say "RC : " rebolrc say "Result : " rebolresult say "Returning results" /* Tim Rue changed "PIPE:torebol" to "t:torebol" to work with changes in rex.r */ call open('result','t:torebol','W') call writeln('result','["'||rebolrc||'" "'||rebolresult||'"]') call close('result') end ---------------8<----------end cut line-----------------------------