Using 'try'

Jim Ault JimAultWins at yahoo.com
Fri Apr 14 12:01:08 EDT 2006


I use try whenever I am parsing a web page and doing a math operation.
Since web formats can change. You might get a "8" every day,but  there is
the occasional "8</bold" that will stop a script doing

put (8 * daysLeftInTheYear) into billableHoursTillNewYears

  The 'try' allows the recovery from this calc error.

More importantly, dates extracted from web pages using regular expressions
can have an extra space or other character, so 'try' comes in very handy
here as well.

Jim Ault
Las Vegas


On 4/14/06 8:37 AM, "Mark Wieder" <mwieder at ahsoftware.net> wrote:

> Graham-
> 
> Thursday, April 13, 2006, 3:01:29 PM, you wrote:
> 
>> Thanks Mark, that really is very clear (and very clever). I'm storing
>> it up for use later...
> 
> Well, while the concept is valid, as Alex has pointed out it really
> isn't necessary in this instance.





More information about the use-livecode mailing list