Difference between revisions of "Switch"

From EDukeWiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 
The '''switch''' statement in con is similar to that in C.
 
The '''switch''' statement in con is similar to that in C.
  
switch <gamevar>
+
  switch <gamevar>
  case <constant>
+
    case <constant>
    <do something>
+
      <do something>
    [[break]]
+
      [[break]]
  case <constant>
+
    case <constant>
    <do something>
+
      <do something>
    break
+
      break
endswitch
+
  endswitch

Revision as of 16:34, 30 August 2005

The switch statement in con is similar to that in C.

 switch <gamevar>
   case <constant>
     <do something>
     break
   case <constant>
     <do something>
     break
 endswitch