Error info about try/catch
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Error info about try/catch
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
HyperActive Software | http://www.hyperactivesw.com
-
- 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
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
so in your standalone app you could
Edited... Nope. That doesn't work. Standalone apps are explicitly banned from displaying error strings.
In mode_standalone.cpp I find
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:
and then in the standalone's error handling code
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
Code: Select all
get line pErrorNum of the cErrorsList of stack "revErrorDisplay"
In mode_standalone.cpp I find
Code: Select all
// We don't include error string in this mode
const char *MCparsingerrors = "";
const char *MCexecutionerrors = "";
From the message box before building the standalone:
Code: Select all
set the uScriptExecutionErrors of stack <mainstack> to the scriptExecutionErrors
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.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9852
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Error info about try/catch
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.
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- 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
Maybe. But it's not a handler, it's a system property.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9852
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Error info about try/catch
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- 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
Bug report is here
https://quality.livecode.com/show_bug.cgi?id=20250
https://quality.livecode.com/show_bug.cgi?id=20250
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Error info about try/catch
Sadly looks like it was hibernated 6 years ago…