Introduction MTB Statements File System Compiler Applications Reference Guide Index

Language Structure Data Division I/O Format Division Procedure Division Mnemonics

(Launch)

Mnemonic: (Launch=string-argument$)
Discussion: The (Launch) mnemonic launches a Windows application or document.

(Under Comet 504, the (Launch) mnemonic performs the same function as the (Shell to DOS) mnemonic.)

String-argument$ is the name of the Windows program or document to be launched. If string-argument$ is null, this mnemonic launches "My Computer" for your current drive.

Note
The (Launch) mnemonic returns a result string. Therefore, immediately after issuing this mnemonic, your program should execute an INPUT statement (or dummy INPUT statement) to retrive this value.

History: This mnemonic was added in the REL release 99.01.
Examples: The following examples are based on this simple program:
  LENGTH 254
  LOCAL A$

  A$ = ...            ! Set launch string
  PRINT (Launch=A$)   ! Launch program or document
  INPUT ""            ! Dummy input to retrieve result string
  RUN "QMONITOR"
where A$ is a string containing the name of the Windows program or document to be launched.

  • Launching a Windows program
    	A$="c:\msoffice\excel\excel.exe"
    	

  • Launching a Windows program and passing it a file name
    	A$="c:\msoffice\excel\excel.exe c:\budget\1998.xls"
    	

  • Launching a spreadsheet file
    	A$="c:\budget\1998.xls"
    	
    When an "xls" file is launched, Windows automatically runs the Excel program (based on the file extension).

  • Launching a word processing file
    	A$="c:\memos\report.doc"
    	
    When a "doc" file is launched, Windows automatically runs the Word program.

  • Launching a text file
    	A$="c:\text\sample.txt"
    	
    When a "txt" file is launched, Windows automatically runs the associated text editor (Notepad, Wordpad, etc.).

  • Launching a graphics file
    	A$="c:\images\logo.gif"
    	
    When a "gif" file is launched, Windows automatically runs the associated graphics viewer.

  • Launching an audio file
    	A$="c:\aol\gotmail.wav"
    	
    When a "wav" file is launched, Windows automatically runs the associated audio player.

  • Launching an intranet document
    	A$="c:\intranet\home.htm"
    	
    When a local "htm" file is launched, Windows automatically runs the default web browser and displays the HTML document.

  • Launching an Internet document (web page)
    	A$="http://www.signature.net/signature/index.html"
    	
    When the launch string starts with "http://", Windows runs the default web browser, connects to the Internet (if not already connected), and displays the named web page.