![]() |
Powered by QM on a Rpi server |
|
KnowledgeBase 00022: Executing Commands on the AccuTerm ClientOverviewSometimes 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 For example, the following program fragment would start Excel to process an item stored in c:\docs\sales.csv. prog = '"c:\program files\microsoft office\office11\excel.exe"' file = 'c:\docs\sales.csv' crt char(27):char(2):'< ' : prog : ' ' : file : char(13) : 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 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. prog = '"c:\program files\microsoft office\office11\excel.exe"' file = 'c:\docs\sales.csv' crt char(27):char(2):'> ' : prog : ' ' : file : char(13) : 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 @(-109, prog : ' ' : file) : Related ArticlesNone. |