Need an example of how to use "try" and "catch"

Jim Hurley jhurley0305 at sbcglobal.net
Thu Mar 22 13:11:12 EDT 2012


It does give an error here. I get the error message:

   button "Button": execution error at line n/a (Object: object does not have this property)

Jim

> 
> Message: 2
> Date: Thu, 22 Mar 2012 09:55:20 -0700
> From: Pete <pete at mollysrevenge.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Re: Need an example of how to use "try" and "catch"
> Message-ID:
> 	<CABx6j9=UY=3N6-VJPmXaSToPEzh0ewJ6kPOpA01VXcxke3TaYA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> You're getting an error because the catch part of try takes only 1
> parameter - the variable that holds the error - not two as in the script.
> 
> Also, as noted by Peter, the try statement doesn't help you with the
> specific example you used since getting a non-existant custom property
> doesn't cause an error.  I've sometimes wished there was a preference
> similar to the "Strict Compilation Mode" to deal with that.
> 
> Pete
> 
> *********************************************





More information about the use-livecode mailing list