- A boolean expression being tested for pass or fail.
- A string indicating the message that will be displayed if the
This is a built-in function that can force a script error if a certain condition is not met. The ASSERT command specifies a condition to check, and a message to generate if the condition turns out to be false. When this occurs, script execution is halted with a Script Error. Otherwise, the script continues.
Please also see the ScriptError() function for another way of doing this.
i as integer i = 3 assert (i==3,"there's a problem with i") // Does not cause a script error assert ( i < 3 , "there's a problem with i" ) // Causes a HeroScript error > SCRIPT ERROR: assert failed, "there's a problem with i", calltrace 27834789234, script DoStuff, line #27