1. Home
  2. SHELLEXECUTE directive

SHELLEXECUTE directive

Launch executables or open files in another application using their file extension, PC Windows only.

No options

Parameters

FILE = text Name of the file to execute
STATUS = scalar Indicates whether the execution of the file was successful (0) or not (1)
MESSAGE = text Saves the error message associated with a failure to execute the file

Description

The SHELLEXECUTE directive can be used to launch executables or start an application associated with a given document extension without knowing the name of the associated application under Windows. For example, you could start a web browser by using the file extension .html.

The FILE parameter specifies the name of the file to execute as a text. This must contain the absolute or relative pathname, for example

'C:/Consult/Data/Info.html'

or

'../../Project/Main.html'

Note we have used a forward slash (/) above as the directory separator character. The the backwards slash ( \ ) is the Genstat continuation character, and would need to be doubled up (\\) to avoid it being interpreted as a continuation.

The STATUS parameter saves a scalar indicating whether the file execution was successful (0) or not (1). If the file execution was unsuccessful you can save the associated error message in a text using the MESSAGE parameter.

Options: none.

Parameters: FILE, STATUS, MESSAGE.

See also

Directive: SUSPEND.

Updated on March 5, 2019

Was this article helpful?