Frictional Games Forum (read-only)

Full Version: Syntax for case-switch?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the syntax for a case & switch structure? Having trouble finding it.
Here's the section on switch-case structures from the AngelCode documentation.

http://www.angelcode.com/angelscript/sdk...ts.html#if


As far as I know AngelCode doesn't support case identifiers beyond integers. For example, I'm pretty sure you can't use case 'j' like you could in native C++.

Note that you will want to end each case code block with a break; -- unless you want to continue through the rest of the cases. You can exclude the break; statement if you wanted to make a cascading code block which adds extra code based on which value is input, but that's a little more semantically advanced than would normally be needed for something like an Amnesia custom story.
Alright! Thank you very much.