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

Bob Sneidar bobs at twft.com
Thu Mar 22 11:52:52 EDT 2012


try
  put "foo" into myVar
  put the value of myVarr
catch theError, theNum
  -- breakpoint
  answer theNum & cr & line1 of theError as sheet
  exit to top
end try

Is that what you mean?

Bob


On Mar 22, 2012, at 8:33 AM, Jim Hurley wrote:

> The dictionary needs an example of how the "try" command is used to catch an error.
> 
> Anyone have an illustration? 
> 
> For example, suppose one wanted to catch an error in the statement:
> 
>  put the {some built-in property of an object] of button "soAndso" into tProp
> 
> Where the built in property may not exist.How would one catch the error and perhaps proceed on the basis of the particular error message?
> 
> Thanks,
> 
> Jim
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list