CommandLine.htm 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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>CommandLine$()</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. If you are writing an application or game that allows starting with special parameters on the command line, you can use this command to retrieve the parameters. <br />
  21. <br />
  22. For example, you might want to start the program with a debug variable set so you can track stuff during execution. So, you could offer the ability to run the executatble with a /debug parameter. If they execute the program with the parameter, then you can set a flag inside your game. <br />
  23. <br />
  24. To simulate the command line passing in the editor, select PROGRAM->PROGRAM COMMAND LINE from the pulldowns and enter a value to be passed at runtime. <br />
  25. <br />
  26. See the example.
  27. </td>
  28. </tr>
  29. </table>
  30. <h1><a href=../2d_examples/CommandLine.bb>Example</a></h1>
  31. <table>
  32. <tr>
  33. <td>
  34. ; CommandLine$() Example <br />
  35. ; Be sure to use PROGRAM->PROGRAM COMMAND LINE from the <br />
  36. ; pull down and put /debug in there to test with. <br />
  37. <br />
  38. a$=CommandLine$() <br />
  39. <br />
  40. If a$="/debug" Then <br />
  41. Print "Debug mode is on!" <br />
  42. debug=1 <br />
  43. Else <br />
  44. Print "No debugging activated." <br />
  45. debug=0 <br />
  46. End If
  47. </td>
  48. </tr>
  49. </table>
  50. <br>
  51. <a target=_top href=../index.htm>Index</a><br>
  52. <br>
  53. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CommandLine&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  54. </html>