DADiSP Worksheet Functions > Function Categories > Operating System Interface > SHELLEXECUTE
Runs an external program or processes a file using the OS shell.
|
"verb", "filename", "params", "dir", modal, showmode, bgtime) |
"verb" |
- |
Optional. A string, the application "verb". Defaults to "", the default verb associated with "filename". Common application verbs include:
|
||||||||||||
"filename" |
- |
A string, the file to process or the name of the program or executable to run. |
||||||||||||
"params" |
- |
Optional. A string, the parameters for the program to run. Defaults to "", no parameters. |
||||||||||||
"dir" |
- |
Optional. A string, the working directory. Defaults to the current directory. |
||||||||||||
modal |
- |
Optional. An integer specifying the parent of the process:
|
||||||||||||
showmode |
- |
Optional. An integer specifying the display mode of the application to run.
|
||||||||||||
bgtime |
- |
Optional. An integer specifying the background monitor time in milliseconds. If specified, the executing program is queried every bgtime milliseconds to determine if it is still running. Ctrl-Break can be used to terminate monitoring of the task. Defaults to 0, no background task monitoring. |
shellexecute("open", "readme.txt", "", gethome)
opens the text file "readme.txt" in the home directory using the system default editor (typically Notepad).
shellexecute("print", "readme.txt", "", gethome)
prints the text file "readme.txt" in the home directory using the system default editor (typically Notepad).
shellexecute("open", gethome + "data\kasha.jpg")
opens the file "kasha.jpg" using the system default image viewer.
shellexecute("open", gethome + "data\kasha.jpg", 1, 3)
same as above except the image is displayed full screen.
shellexecute("open", which("dadisp.wav"))
opens the file "dadisp.wav" using the system default audio player (typically MediaPlayer).
An error value is returned if the program cannot be executed.
If a file is specified, SHELLEXECUTE attempts to load the appropriate application to display the file.
If bgtime is specified, the executing task is queried every bgtime milliseconds to determine the task state. In this case, task monitoring can be terminated by pressing Ctrl-Break.
See RUN to execute a program and wait until it has completed.