28 lines
1.9 KiB
HTML
28 lines
1.9 KiB
HTML
|
|
<html><head><title>Command: End Select </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'> End Select </span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>The closing command in a SELECT structure.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command ends the <a href='SELECT.htm'>SELECT</a> structure. If you are using <a href='DEFAULT.htm'>DEFAULT</a> commands, this is the ending point of that command set's execution. See <a href='SELECT.htm'>SELECT</a>, <a href='CASE.htm'>CASE</a>, and <a href='DEFAULT.htm'>DEFAULT</a> for more information.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; SELECT/CASE/DEFAULT/END SELECT Example<br>
|
||
|
|
; Assign a random number 1-10<br>
|
||
|
|
mission=Rnd(1,10)<br>
|
||
|
|
<br>
|
||
|
|
; Start the selection process based on the value of 'mission' variable<br>
|
||
|
|
Select mission<br>
|
||
|
|
<br>
|
||
|
|
; Is mission = 1?<br>
|
||
|
|
Case 1<br>
|
||
|
|
Print "Your mission is to get the plutonium and get out alive!"<br>
|
||
|
|
<br>
|
||
|
|
; Is mission = 2?<br>
|
||
|
|
Case 2<br>
|
||
|
|
Print "Your mission is to destroy all enemies!"<br>
|
||
|
|
<br>
|
||
|
|
; Is mission = 3?<br>
|
||
|
|
Case 3 <br>
|
||
|
|
Print "Your mission is to steal the enemy building plans!"<br>
|
||
|
|
<br>
|
||
|
|
; What do do if none of the cases match the value of mission<br>
|
||
|
|
Default <br>
|
||
|
|
Print "Missions 4-10 are not available yet!"<br>
|
||
|
|
<br>
|
||
|
|
; End the selection process<br>
|
||
|
|
End Select<br>
|
||
|
|
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
|
||
|
|
</html>
|