| Introduction | Reporter Commands | Index |
| Syntax: | LAUNCH Windows-program-or-document |
| Placement: | Place the LAUNCH command after the REPORT command. |
| Discussion: |
Under Comet98 and greater, the LAUNCH command launches a Windows
application or document.
Here are some ways the LAUNCH command can be used:
|
| History: | This command was added in version 99.01. |
| Example: |
The following report erases and then creates a data file
named TEMPFILE.CSV ("CSV" means "comma separated values")
on directory DSK. The PRINTER statement includes a "D"
parameter, which specifies a delimited format for the
output data.
The report inputs data from the CUSTOMER file and outputs data to the TEMPFILE.CSV file. After the report has been processed, the Reporter launches the Excel spreadsheet program which opens the TEMPFILE.CSV file. ERASE TEMPFILE.CSV,DSK PRINTER TEMPFILE.CSV,DSK,D INPUT CUSTOMER REPORT PRINT CUST.NUMBER;CUST.NAME;CREDIT.LIMIT;CURRENT.AR; AR.OVER.30.DAYS;AR.OVER.60.DAYS;AR.OVER.90.DAYS; AR.OVER.120.DAYS LAUNCH c:\msoffice\excel\excel.exe c:\comet\dsk\tempfile.csv |
| Notes: |
The Launch command expects the target file to be local to the client PC. If this
is not the case you may need to execute a copyfile program prior to the launch,
then launch the local copy of the file.
The Enter command can be used to run your copyfile program. Before writing your own copyfile program you might try using the CUtlCpy utility which is released as part of the UTL directory: ERASE MyTextFile.txt,DSK PRINTER MyTextFile.txt,DSK INPUT CUSTOMER REPORT PRINT CUST.NUMBER;CUST.NAME;CREDIT.LIMIT;CURRENT.AR; AR.OVER.30.DAYS;AR.OVER.60.DAYS;AR.OVER.90.DAYS; AR.OVER.120.DAYS ENTER CUtlCpy,,"MyTextFile.txt,DSK,MyPersonalTextFile.txt,$(CATEMP),Y,Y,T" CUtlCpy includes an option to launch the destination file after doing the copy so in this case you don't even need the Reporter launch! |