Menu

Sub-command and External Function Handler interfaces

Help
foxpat
2021-03-03
2021-03-03
  • foxpat

    foxpat - 2021-03-03

    Regina defines
    Sub-command Handler interface:
    "a piece of code, that is called to handle a command to an external environment in Rexx. It must be either a subroutine in the application that started the interpreter, or a subroutine in a dynamic link library".
    Typically, an application will set up a sub-command handler before starting a Rexx script.

    External Function Handler interface:
    "a piece of code, that is called to handle external functions and subroutine calls in Rexx. It must be either a subroutine in the application that started the interpreter, or a subroutine in a dynamic link library.
    All external functions written in a language other than Rexx must be registered with the interpreter before starting a Rexx script.

    Can I do the same with ooRexx ?

    I want to implement the custom command handlers in my C++ application, register them with ooRexx and them invoke the interpreter loading a rexx file wich uses the custom commands. Can I do this with ooRexx? is there some example?
    Not interested in coding a dll and loading its functionality from the rexx script, I saw examples of this but I want to avoid dlls, the custom commands code should be hosted in the main app invoking the interpreter.
    Any help appreciated. Thanks

     
    • Rick McGuire

      Rick McGuire - 2021-03-03

      The two APIs for doing this are RexxRegisterSubcomExe and RexxRegisterFunctionExe. This registers named command and function handlers using entry points within your application rather than using entry points in a dll. I don't think we have any examples that show this outside of programs written as test cases.

       
  • foxpat

    foxpat - 2021-03-03

    Thanks Rick, perfect pointers!

     

Log in to post a comment.