How return an error ?

Jim Ault JimAultWins at yahoo.com
Sat Feb 11 14:28:35 EST 2006


On 2/11/06 11:01 AM, "Girard Damien" <dam-pro.girard at laposte.net> wrote:
> 
> I wan't to return a specific error message (internaly in Runrev), I wrote
> complex commands, who call a lot of subcommands and functions, and when an
> error is uncountered, I wan't to return it. The advantage is to permit to
> the developers to understand why there is an error. And this permit to the
> software to manage these errors. (For exemple, you call a command
> in a try structure, and you can manage this error with catch).
> 

In that case
on hellotest theNumber
     return isnumber(theNumber) --which will give exactly what Rev gives
end if

Basically, there are two kinds of errors to check for, I think.

Type 1 is a result that does not make sense or falls out of bounds, like
line number of a field  = 0, isnumber, the result "not found", etc.

Type 2 is an error that will stop the program (9*cat), thus the 'try-catch'
structure to avoid this and let the loop gracefully exit or take another
path.


Jim Ault
Las Vegas





More information about the use-livecode mailing list