Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax for case-switch?
Author Message
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #1
Syntax for case-switch?

What is the syntax for a case & switch structure? Having trouble finding it.

Dark Seclusion Here
04-29-2012 02:02 AM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,214
Joined: Mar 2011
Reputation: 57
Post: #2
RE: Syntax for case-switch?

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.

(This post was last modified: 04-29-2012 02:11 AM by palistov.)
04-29-2012 02:11 AM
Find all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #3
RE: Syntax for case-switch?

Alright! Thank you very much.

Dark Seclusion Here
04-29-2012 02:21 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)