Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Passing a subroutine name into a procedure and executing it

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing a subroutine name into a procedure and executing it

    That's not possible. But you could do it with procedures and procedure pointers. See the example below. You could even pass in parameters for EXESUB to pass on to the procedures, and pass back a return value from the procedures. For any procedure you wanted to call through this EXESUB procedure, the procedure would have to have identical parameters and return value to the prototypes defined in EXESUB. In the example below, it's simple, since the procedures don't have any parameters or return value.
    Code

  • #2
    Passing a subroutine name into a procedure and executing it

    I know this sounds like an odd question, but I have searched forever and cannot find an answer. Is it possible to pass a subroutine name into a procedure, and then execute the subroutine (with the EXSR and a variable name that holds the subroutine name) in the procedure? Below is some psuedo code showing what I am thinking. Thanks,
    Code

    Comment


    • #3
      Passing a subroutine name into a procedure and executing it

      Barbara, Thanks for the code snippet. Although it isn't what I was looking for (which as you mention is not possible), I will keep the code snippet, as I am sure it will prove beneficial in the future. Thanks again for the response. Thanks, Adam

      Comment

      Working...
      X