KnowledgeBase 00022: Executing Commands on the AccuTerm Client

Overview

Sometimes it is useful to execute commands on the client PC from a QM
terminal session. The AccuTerm terminal emulator, bundled with commercial QM
licences, includes the ability to execute either synchronous and
asynchronous commands.

This article gives a simple example of how to use this feature. The general
principles may be applicable to other terminal emulators.

Executing an Asynchronous Command

To execute an asynchronous command where the program running in the AccuTerm
session continues in parallel with the executed command, the application must
send a sequence
ESC STX < command CR
to the terminal.

For example, the following program fragment would start Excel to process
an item stored in c:\docs\sales.csv.

When using a terminal type with the -at suffix for AccuTerm specific
features, the third line of the above example can be replaced by

crt @(-108, prog : ' ' : file) :

This approach has the advantage that the application would be compatible
with any terminal emulator for which the @(-108) function has been defined in
the terminfo database to return a control code that executes an asynchronous
command.

Executing a Synchronous Command

To execute a synchronous command where the program running in the AccuTerm
session pauses until the executed command terminates, the application must
send a sequence
ESC STX > command CR
to the terminal.

For example, the following program fragment would start Excel to process
an item stored in c:\docs\sales.csv and wait for the user to exit from Excel.