Subcommand handlers vs. external functions 
Author Message
 Subcommand handlers vs. external functions

Hello.

Can somebody explain to me the difference between subcommand handlers
and external functions?

What are the benefits/drawbacks of each?

If I want to invoke REXX via RexxStart() from an application, and allow
the script to access commands/functions defined in an external DLL,
should I use subcommand handlers or external functions?

Thanxalot!

Have fun,
Alex.



Fri, 05 Feb 1999 03:00:00 GMT  
 Subcommand handlers vs. external functions

Quote:

>Can somebody explain to me the difference between subcommand handlers
>and external functions?

The difference is in the REXX syntax used to call them.

Subcommand:    "do something" args
Function:      a = do_something(args)

Quote:
>What are the benefits/drawbacks of each?

Functions are in general more flexible, because you can pass more than
one argument to a function, and get a string result back.  On the other
hand, you have to register each function separately whereas you only need
one subcommand handler to process all the commands, and consequently there
is less of a name-clash problem with subcommands.

Quote:
>If I want to invoke REXX via RexxStart() from an application, and allow
>the script to access commands/functions defined in an external DLL,
>should I use subcommand handlers or external functions?

It's a matter of taste I would think.  Probably most people would choose
subcommands for all the commands/functions except those which return
something useful.


http://www.comlab.ox.ac.uk/oucl/users/ian.collier/index.html

New to this group?  Answers to frequently-asked questions can be had from
http://rexx.hursley.ibm.com/rexx/ .



Fri, 05 Feb 1999 03:00:00 GMT  
 Subcommand handlers vs. external functions

Quote:

>                                                           On the other
>hand, you have to register each function separately

Of course you don't _have_ to - you could use the "external function exit"
instead and examine each function call as it goes by.
Quote:

>http://www.comlab.ox.ac.uk/oucl/users/ian.collier/index.html



Fri, 05 Feb 1999 03:00:00 GMT  
 Subcommand handlers vs. external functions


   Mon, 19 Aug 1996 08:09:18 GMT

As usually, it depends...
Functions return something, subcommands don't.

For example, I am working on a Rexx CGI function library.
The user may issue an "Address HTML" to have subsequent output sent to
the browser without a Say statement or LineOut call but nothing is
returned. The procedure HTML is registered as a subcommand in my .dll.
Other functions do something and return something to the  caller.
They are registered as functions.

Hope this helps!
Saluti, Albert



Mon, 08 Feb 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HELP: External command (Subcommand) handler to update REXX parameters

2. Registration of Subcommand handler failed

3. handler-case vs handler-bind

4. handler-bind vs. handler-case

5. MicroFocus External file handler

6. External File Handler - Microfocus

7. function vs. symbol-function

8. handy function for exception handler output.

9. Internal vs. External State

10. Internal vs External SORTs

11. vrml.eai.* vs vrml.external.*

12. global vs external

 

 
Powered by phpBB® Forum Software