Track down a runtime problem
BASIC IN YOUR GAME
A script can pass validation and still receive a value that makes no sense for your game. If a ticket count must be zero or greater, say so in the code.
FUNCTION Run()
DIM count = -1
TRY
ASSERT count >= 0
RETURN "Ready"
CATCH problem
RETURN "Check the count"
END TRY
END FUNCTIONASSERT checks the expression. With count at -1, the check fails and control moves to CATCH. The code returns Check the count. With a nonnegative count it returns Ready. The name problem holds the failure details.
| The script will not validate | Start with the reported line and the line before it. Check quotes, closing parentheses and matching block endings. |
|---|---|
| No visible result | PRINT goes to the output. For a player-facing response, change a visible GUI label or call ShowMessage. |
| A click seems dead | Check that the GUI is visible, the button is enabled, its Click target is the script ID and the script is enabled. Start Run with a short PRINT to see whether the click got that far. |
| An event never arrives | Check the subscription box, the matching handler name and whether the event actually occurred after the listener was available. |
