Switch

From EDukeWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

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

The case keyword works like an ifvare statement, and default operates on every possibility that is not specified by a case statement. Each case block must be terminated with a break statement.

See: Control Structures @ C++ Documentation