The WIL Tutorial
|
There are several functions that you can use to start an application, most of which share a common syntax. To name a few: Run (program-name, parameters)We've already seen the Run function. This function starts a program in a "normal" window. Windows, or the application itself, decides where to place the application's window on the screen. Example:
Run("notepad.exe", "myfile.txt")
If the program has an EXE extension, its extension may be omitted:
Run("notepad", "myfile.txt")
Also, you can "run" data files if they have an extension in WIN.INI which is associated with an executable program. So, if TXT files are associated with Notepad:
Run("myfile.txt", "")
would start Notepad, using the file MYFILE.TXT. When you specify a file to run, WIL looks first in the current directory, and then in the directories on your system path. If the file is not found, WIL will return an error. You can also specify a full path name for WIL to use, as in:
Run("c:\windows\apps\winbatch.exe", "")
RunZoom (program-name, parameters)RunZoom is like Run, but starts a program as a full-screen window.
Example:RunZoom("excel", "bigsheet.xls")
RunIcon (program-name, parameters)RunIcon starts a program as an icon at the bottom of the screen.
Example:RunIcon("notepad", "")
All these Run functions simply launch the program and continue with WIL processing. If you need to wait until the program exits before continuing, then there are a number of other suitable functions also available.
RunWait (program-name, parameters)RunWait starts a program and waits for it to exit before continuing.
RunZoomWait (program-name, parameters)RunZoomWait starts a program as a full screen window and waits for it to exit before continuing.
RunIconWait (program-name, parameters)RunIconWait starts a program as an icon at the bottom of the screen and waits for it to exit before continuing. If all these Run functions are too much for you, there is also the combination RunShell function, which combines all the capabilities of the Run functions and adds additional capability.
RunShell (program-name, parameters, working dir, view, waitflag)RunShell is an advanced form of the Run function that even allows the specification of a working directory, along with the window view mode and whether or not to wait for completion of the run program in a single function. ShellExecute (program-name, parameters, working dir, view, operation)ShellExecute runs a program via the Windows ShellExecute command and allows the specification of a working directory, along with the window view mode and the operation to perform on the specified file.
|