ExecFile.htm 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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>ExecFile( file$ )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. file$ - the file to be executed
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. The usefulness of this command is really mostly for calling some system level command, launching a browser, etc. <br />
  21. <br />
  22. Note: This command uses ShellExecute to allow you to 'open' any file (like a .doc or .txt) file with its default associated program. <br />
  23. <br />
  24. Also: if the filename path has spaces in it you may will need to chenge the call like so: <br />
  25. <br />
  26. ExecFile (Chr$(34)+"example file name.exe"+Chr$(34)) <br />
  27. <br />
  28. This adds the " (quotation mark) character to the beginning and end of the text string.
  29. </td>
  30. </tr>
  31. </table>
  32. <h1><a href=../2d_examples/ExecFile.bb>Example</a></h1>
  33. <table>
  34. <tr>
  35. <td>
  36. ; ExecFile sample - RUN THIS WINDOWED! <br />
  37. Graphics 320,240,0,2 <br />
  38. <br />
  39. filename$ = Chr$(34) + "calc.exe" + Chr$(34) <br />
  40. <br />
  41. Text 5,5, "press any key to run CALC.EXE!" <br />
  42. Flip <br />
  43. WaitKey <br />
  44. <br />
  45. ExecFile(filename$) <br />
  46. <br />
  47. Text 5,25, "Press any key to quit." <br />
  48. Flip <br />
  49. WaitKey <br />
  50. End
  51. </td>
  52. </tr>
  53. </table>
  54. <br>
  55. <a target=_top href=../index.htm>Index</a><br>
  56. <br>
  57. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=ExecFile&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  58. </html>