The LAUNCH command invokes/runs any associated files along with required programs.
Options
filename.ext
The name of file which has a corresponding association registered with Windows.
|<parameters>
To specify additional parameters
|W
To specify Wait Until Finished option
About the LAUNCH Command
LAUNCH command is used to execute (or LAUNCH) another application or process, from within R:BASE 7.1 for Windows and higher. It designates which file to execute. This means that the FileName can be set to any file that has a corresponding association registered with Windows. For example, setting FileName to 'RBW65PP3.TXT' will invoke the Windows NotePad when LAUNCHed. If a full path is not specified, the current search path is used.
The enhanced LAUNCH command allows you to set the FileName property to the file to be executed, and specify any command line parameters using the "Parameters". The selected program will start when the LAUNCH command is used. The LAUNCHed application will start in the same directory as the executable file or in the directory referenced, if specified.
The enhanced LAUNCH command also allows you to use the "Wait Until Finished" option to specify whether or not you want R:BASE 7.1 for Windows and higher to sleep while the launched program executes or continue running. If the Wait Until Finished parameter "|W", i.e. pipe W with no space, is added to the LAUNCH command, the R:BASE will sleep until the launched process completes. If the Wait Until Finished parameter "|W" is not specified, the launched process is executed in its own thread, and the R:BASE will continues to execute.
At the R> prompt or in a command file:
Example 01:
LAUNCH charts.VBS
will invoke VBScript:Windows Scripting Host Sample and will demonstrate how to access Excel using the Windows Scripting Host in an active R:BASE session.
or
LAUNCH c:\windows\samples\wsh\charts.vbs
Example 02:
LAUNCH myfile.DOC
will invoke MSWord (if installed), and let you edit the file in an active R:BASE session.
or
LAUNCH c:\mydocs\myfile.doc
Example 03:
LAUNCH myfile.WPD
will invoke Corel WordPerfect (if installed), and let you edit the file in an active R:BASE session.
or
LAUNCH c:\mydocs\myfile.wpd
Example 04:
LAUNCH myfile.TXT
will invoke MS NotePad, and let you edit the file in an active R:BASE session.
or
LAUNCH c:\mydocs\myfile.txt
Example 05:
LAUNCH myfile.PDF
will invoke Adobe Acrobat Reader, and let you view the file in an active R:BASE session.
or
LAUNCH c:\mydocs\myfile.pdf
Example 06: (To automate e-mails via R:BASE)
If you know the e-mail tags of your default e-mail program, using the LAUNCH command, you could easily achieve that task of automating e-mails.
SET VAR vMailTo TEXT = NULL
SET VAR vCustID INTEGER = 2001
SELECT ('mailto:'+EMailAddress) INTO vMailTo INDIC IvMailTo +
FROM Contacts WHERE CustId = .vCustID
LAUNCH .vMailTo
That will launch default e-mail programs with filled in To:
You could follow the same scenario for other e-mail tags, such as:
Subject:
Cc:
Bcc:
Attached:
Message:
Example 07: (Simple LAUNCH command)
LAUNCH RBW65PP3.TXT
This will invoke the Windows NotePad with RBW65PP3.TXT.
Example 08: (LAUNCH command with Parameters)
LAUNCH C:\WordDocuments\TestFile.DOC|/MacroName
This will invoke the MS Word with TestFile.DOC running MacroName.
Notice the pipe "|" symbol right after TestFile.DOC to specify additional parameter.
Example 09: (LAUNCH command with Parameters and Wait Until Finished option)
LAUNCH C:\WordDocuments\TestFile.DOC|/MacroName|W
This will invoke the MS Word with TestFile.DOC using MacroName as a main window while R:BASE 2000 (version 6.5++) or higher sleeps in the back. You will have to Exit MS Word in order to get control back to R:BASE window/application.
Notice the additional pipe "|" symbol with "W" right after /MacroName to specify Wait Until Finish option.
Example 10: (LAUNCHing NotePad with Wait Until Wait option)
LAUNCH RBW65PP3.TXT||W
This will invoke the Windows NotePad with RBW65PP3.TXT as a main window while R:BASE sleeps in the back. You will have to Exit NotePad in order to get control back to R:BASE window/application.
Notice the two (2) pipes with no spaces right after RBW65PP3.TXT. The first pipe with no parameters and no space while the second pipe with Wait Until Finished "W" option.
* NO NEED TO ZIP OUT or running batch files, etc.
* NO flashing screens (in and out of DOS).
* LAUNCH command is also supported in EEPs.
The new LAUNCH command in R:BASE 7.1 will execute ANY windows program as long as it is installed and the file extension is associated in the registry.