Files
BlitzNext/_release/help/commands/2d_commands/ExecFile.htm
T
2014-12-08 12:43:20 +13:00

59 lines
1.5 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>ExecFile( file$ )</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
file$ - the file to be executed
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
The usefulness of this command is really mostly for calling some system level command, launching a browser, etc.
<br />
<br />
Note: This command uses ShellExecute to allow you to 'open' any file (like a .doc or .txt) file with its default associated program.
<br />
<br />
Also: if the filename path has spaces in it you may will need to chenge the call like so:
<br />
<br />
ExecFile (Chr$(34)+"example file name.exe"+Chr$(34))
<br />
<br />
This adds the " (quotation mark) character to the beginning and end of the text string.
</td>
</tr>
</table>
<h1><a href=../2d_examples/ExecFile.bb>Example</a></h1>
<table>
<tr>
<td>
; ExecFile sample - RUN THIS WINDOWED!
<br />
Graphics 320,240,0,2
<br />
<br />
filename$ = Chr$(34) + "calc.exe" + Chr$(34)
<br />
<br />
Text 5,5, "press any key to run CALC.EXE!"
<br />
Flip
<br />
WaitKey
<br />
<br />
ExecFile(filename$)
<br />
<br />
Text 5,25, "Press any key to quit."
<br />
Flip
<br />
WaitKey
<br />
End
</td>
</tr>
</table>
<br>
<a target=_top href=../index.htm>Index</a><br>
<br>
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>
</html>