Thierry Douez wrote:

A small trick:

   send "want_the_return_value" to me
   put  the result

on want_the_return_value
   return 42
end want_the_return_value

This raises another question:

Should we have a general error function?

Right now "the result" sometimes contains data, but sometimes contains error info. The "it" variable also sometimes contains data, but (almost?) never contains error info. Sometimes errors put error info in "the result", and other times they explicitly throw an error, requiring the use of try/catch in those cases but not others.

That's a whole lotta "sometimes".

We have a function for system errors in sysError, but that only applies to things happening outside of LC (file I/O, processes, etc.).

Wouldn't life be much easier if we had one reliable way to obtain info whenever an error occurs in our scripts?

Maybe simply:

  get scriptError()

?

Ideally this could be handled like the changes to "word" and "char", in which new tokens are rolled out while still maintaining the older way also for several versions, so we have plenty of time to update code at our leisure, using the simpler method going forward while the old code continues to work.

And given that Open Language is just around the corner, wouldn't it seem this is the best moment to clean up the mish-mash of inconsistent error handling we have to deal with now?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to