Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


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

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#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
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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
FragdaddyXXL Offline
Member

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

Alright! Thank you very much.

Dark Seclusion Here
04-29-2012, 02:21 AM
Find




Users browsing this thread: 1 Guest(s)