throw vs the result

Jan Schenkel janschenkel at yahoo.com
Sun May 1 17:40:39 EDT 2005


--- Dar Scott <dsc at swcp.com> wrote:
> 
> On May 1, 2005, at 3:30 AM, Jan Schenkel wrote:
> 
> > I personally prefer the try-throw-catch trinity,
> as it
> > makes for cleaner code than indented if-then-else
> > structures.
> 
> If a library errors comes in only the result, then
> you can do this:
> 
>     moveRobot robotName, plan
>     get the result
>     it it is not empty then throw it
> 
> Instant thrown errors.
> 
> Dar
> 

Ah yes, but then I have to check the result myself to
throw an error, and that's what I wanted to avoid ;-)
My earlier suggestion is backwards-compatible but
allows people who like try-throw-catch, to structure
their code in a more readable way.

Jan Schenkel.

Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the use-livecode mailing list