End Select.htm 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>End Select</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. None.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This command ends the SELECT structure. If you are using DEFAULT commands, this is the ending point of that command set's execution. See SELECT, CASE, and DEFAULT for more information.
  21. </td>
  22. </tr>
  23. </table>
  24. <h1><a href=../2d_examples/End Select.bb>Example</a></h1>
  25. <table>
  26. <tr>
  27. <td>
  28. ; SELECT/CASE/DEFAULT/END SELECT Example <br />
  29. ; Assign a random number 1-10 <br />
  30. mission=Rnd(1,10) <br />
  31. <br />
  32. ; Start the selection process based on the value of 'mission' variable <br />
  33. Select mission <br />
  34. <br />
  35. ; Is mission = 1? <br />
  36. Case 1 <br />
  37. Print "Your mission is to get the plutonium and get out alive!" <br />
  38. <br />
  39. ; Is mission = 2? <br />
  40. Case 2 <br />
  41. Print "Your mission is to destroy all enemies!" <br />
  42. <br />
  43. ; Is mission = 3? <br />
  44. Case 3 <br />
  45. Print "Your mission is to steal the enemy building plans!" <br />
  46. <br />
  47. ; What do do if none of the cases match the value of mission <br />
  48. Default <br />
  49. Print "Missions 4-10 are not available yet!" <br />
  50. <br />
  51. ; End the selection process <br />
  52. End Select <br />
  53. </td>
  54. </tr>
  55. </table>
  56. <br>
  57. <a target=_top href=../index.htm>Index</a><br>
  58. <br>
  59. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=End Select&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  60. </html>