Externals Under 2.7.x

Mark Wieder mwieder at ahsoftware.net
Fri Feb 9 22:10:06 EST 2007


Dave-

Friday, February 9, 2007, 9:18:56 AM, you wrote:

> In my case it wasn't returning an error, but, I wondered about this
> too. It seems weird that you can't seem to get an error signal and  
> then get an error message if there is an error.

> If you set the error flag to false, then how can you tell if the data
> returned is an error message or if it's good data??

Normally you want to pass False in the error return variable. If it's
True then script processing will halt and you'll get a generic error
dialog. The only time you'll really want to set error to True is when
your external routine has run into a critical error and you really do
want to halt execution of any further script commands.

If you set error to False you still have control over the result value
returned to the engine when your external routine exits. This is the
proper way to signal to the engine that an error has occurred, and
that way the script that called the external routine can parse the
result and determine whether or not an error has occurred.

For functions you will normally return your result in the "it"
variable and thus you have "the result" available for an error
message. I've got a writeup on this at

http://www.revjournal.com/tutorials/everything-you-know.html

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list