Error info about try/catch

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7257
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Error info about try/catch

Post by jacque » Sat May 27, 2023 6:08 pm

I'm not sure why it's omitted in standalones, so I'm confused too. Especially since the error codes are duplicated in the revErrorDisplay stack. I haven't looked but it's possible that scriptExecutionErrors contains IDE errors that wouldn't apply to standalones.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Error info about try/catch

Post by mwieder » Sat May 27, 2023 6:46 pm

If you include the revErrorReport stack in your standalone then you do have access to the list, but you have to grab it yourself.
In the script for revSaveAsStandalone.livecodescript I see

Code: Select all

      set the cErrorsList of stack "revErrorReport" to the scriptExecutionErrors
      set the cScriptErrors of stack "revErrorReport" to the scriptParsingErrors
so in your standalone app you could

Code: Select all

get line pErrorNum of the cErrorsList of stack "revErrorDisplay" 
Edited... Nope. That doesn't work. Standalone apps are explicitly banned from displaying error strings.
In mode_standalone.cpp I find

Code: Select all

// We don't include error string in this mode
const char *MCparsingerrors = "";
const char *MCexecutionerrors = "";
So the only way I've found to have the error strings in a standalone app is to set a custom property and then use that:
From the message box before building the standalone:

Code: Select all

set the uScriptExecutionErrors of stack <mainstack> to the scriptExecutionErrors
and then in the standalone's error handling code

Code: Select all

get line pErrorNum of the uScriptExecutionErrors of this stack
Last edited by mwieder on Sun May 28, 2023 7:37 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Error info about try/catch

Post by FourthWorld » Sat May 27, 2023 8:45 pm

Remember when IDE-specific handlers had a prefix which allowed is to identify them as such?

This confusion about error string availability is another example of why that was useful.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Error info about try/catch

Post by mwieder » Sat May 27, 2023 9:04 pm

Maybe. But it's not a handler, it's a system property.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Error info about try/catch

Post by FourthWorld » Sun May 28, 2023 2:00 am

mwieder wrote:
Sat May 27, 2023 9:04 pm
Maybe. But it's not a handler, it's a system property.
All the weirder, a system property unavailable to standalones built with the system.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Error info about try/catch

Post by mwieder » Sun May 28, 2023 7:42 pm


stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Error info about try/catch

Post by stam » Sun May 28, 2023 8:17 pm

Sadly looks like it was hibernated 6 years ago…

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”