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

Peter M. Brigham, MD pmbrig at gmail.com
Thu Mar 22 13:38:38 EDT 2012


On Mar 22, 2012, at 1:21 PM, Jim Hurley wrote:

> Thanks Peter.
> 
> The problem now is what do these bloody error numbers translate into.
> Is the a list somewhere?


Jacque posted this two days ago:

--------
On 3/20/12 12:37 PM, Ralph DiMola wrote:
> OK, I give up. How do you translate error number into descriptive
> text?

There's a plugin that Richard Gaskin and I developed. I've been trying to upload it to RevOnline for some time but it won't let me. Until that gets fixed, anyone who wants it can grab it from my Dropbox:

<http://dl.dropbox.com/u/23431607/LiveCode%20Error%20Lookup.livecode.zip>

The advantage of this little stack over a static resource (besides being free) is that it dynamically loads the error list from the currently running copy of LiveCode. That means it will never go out of date, and will change depending on which version of LiveCode you open it in.

There's a second card that's intended for use with debugging iOS errors copied from the Console app. There's an Info button in the stack for more details.

It hasn't been thoroughly tested but I've been using it for some time without any problems. The scripts are open, so you can change it if you want. If you do, please let me know so I can update the "master" copy.
---------

> When I try:
> 
> on mouseUP
>   try
>  put the cantdelete of me into temp 
> catch tErr
> --- if tErr is ??????
> end try
> end mouseUP
> 
> I get an error of 348,0,0

first item is the error number, second item is the line number of the script where it hangs, and the third is the character number in the line. Error 348 is:

348	Object: object does not have this property

Not sure what line 0 char 0 means. Maybe someone else knows?

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list