hello,
in the Squirrel 3.0 reference manuel found :
Quoteassert(exp)
throws an exception if exp is null
is that this function is available in the wizard scripts ?
if not, how to raise an exception in a wizard script?
thank you.
As far as I know we're still using squirrel 2.x, so you have to check its manual.
thank you for the answer.
Squirrel 2.2 is identical ...
Quoteassert(exp)
throws an exception if exp is null
OK. Have you tried it?
What do you expect to happen?
Who is going to catch it?
QuoteOK. Have you tried it?
yes with my configuration
QuoteWhat do you expect to happen?
crash Code::Blocks !!!
QuoteWho is going to catch it?
I do not know, this is why I ask questions?
Quote from: LETARTARE on June 11, 2013, 11:08:15 AM
crash Code::Blocks !!!
Why?
But I'm sure it won't happen, probably you'll get an error in the log or it will be silently ignored.
I think I misunderstood
QuoteWhat do you expect to happen?
in fact, this is what happened during the test
local board = null;
assert(board)This exception should be recovered by "Code::Blocks" to notify the user ?
This is not the case.
I don't understand sorry. Please explain better or provide a sample script.
Quote from: LETARTARE on June 11, 2013, 12:24:55 PM
local board = null;
assert(board)
This exception should be recovered by "Code::Blocks" to notify the user ?
I tried the code in "Scripting console", there will pop an error message box, and no crash of C::B.
Quote
Welcome to the script console!
> local board = null;
> assert(board)
AN ERROR HAS OCCURED [the index 'board' does not exist]
CALLSTACK
*FUNCTION [main()] ScriptConsole line [1]
LOCALS
[this] TABLE
AN ERROR HAS OCCURED [the index 'board' does not exist]
CALLSTACK
*FUNCTION [main()] ScriptConsole line [1]
LOCALS
[this] TABLE
If I add the code in a project wizard script, then I see a message box said: script error has occurred, please press yes to see the exact errors.
Then I click Yes, there will be a dialog to show the detailed error messages. Still no crash of C::B.
@ollydbg
thank you very much for taking the time to check these two lines of code.
So I try on the other machine with the same configuration, and I confirm your results: we get the warning messages.
I incriminates my first PC, I'll check.
Thank you again for the constructive responses