:Reflect Command [REFLECT]
Executes a Reflection command on your PC. Qedit checks whether the command succeeds or fails. A failure is treated like the failure of an MPE command. :Reflect allows you to control a PC from within your HP e3000 UDCs or batch job (send and receive files, backup your PC, execute PC programs, etc.).
:REFLECT reflection command
(Defaults: none)
Examples
/reflect type mreport.crt /reflect shell lotus
Version of Reflection
The :Reflect command depends on Reflection’s ability to accept commands using an escape sequence, and to be able to pass back a status code indicating whether the command succeeded. These features are implemented in the following versions of Reflection:
- Reflection 1 for DOS version 1.40 or later
- Reflection 3/7 for DOS version 1.55 or later
- All versions of Reflection for Windows
- All versions of Reflection for Macintosh
Batch PC Control
You can use the :Reflect command in a batch job, but you must do a :File equation to specify the PC that you wish to control. The file name is Qedcrt and you must redirect it to a hard-wired PC port. If you wish to switch to another PC, use Set Vis Stop and another :File command. Here is an example:
!job pcbackup,user.acct !file qedcrt;dev=29 !run qedit.pub.robelle reflect dir continue reflect dri {oops} Your Reflection command failed. 10 = ERROR-CODE from the Reflection PC. UNKNOWN COMMAND NAME. (CIERR 975) file backup = backup.wade continue reflect backup c:\*.* /S {need Reflection PLUS option} set vis stop {prepare to access 2nd PC} file qedcrt;dev=58 {define second PC} file backup=backup.rockey continue reflect backup c:\*.* /S {add /C for full backup} exit !eoj
Debugging PC Errors
The examples above show PC functions with and without error control. If you want the job to continue, even if the :Reflect command fails, put a :Continue in front of each :Reflect command. The error CIERROR 975 will be returned if the :Reflect command fails for any reason.
Remember, in order to get :Reflect to work in batch:
- The PC must be turned on.
- Reflection must be running.
- The Reflection baud rate must be the same as in the MPE configuration.
- The PC must not be logged on to the HP e3000.
- For the Backup command to work, Reflection must be a Plus version.
If the :Reflect command fails, Qedit will display the Reflection error-code. If you have a version of Reflection that is capable of passing back the error-code, Qedit will also put the error-code in a JCW named QEDPCERROR. For an explanation of Reflection error-codes, refer to the Reflection Command Language reference manual.
Using Line Mode
Some Reflection command files work fine when executed from the Alt-Y command line, but fail (possibly leaving your terminal in a locked state) when invoked with Qedit’s :Reflect command.
The reason is that Qedit’s :Reflect command sends an escape code to Reflection to invoke the command. Then Qedit waits for Reflection to send back a status code to indicate when the command is finished. While Qedit is waiting for the result code from Reflection, it isn’t capable of executing other Qedit commands — it’s already executing a Qedit command! The only thing that Qedit is capable of doing while it’s waiting is to execute any MPE commands that Reflection might send to the HP e3000. The reason MPE commands must be accepted is that Reflection sends a :Run command for PCLINK whenever a file transfer is requested.
As long as the command or command file doesn’t attempt to transmit any data to the HP e3000, :Reflect will probably work the same way as Alt-Y.
For example, here is a Reflection command file that works from Alt-Y, but not from :Reflect.
; BYE ; This command file gets me out of Qedit, logs me off ; the HP e3000 and exits from Reflection back to DOS. ; transmit "exit^M" wait 0:01:00 for "^Q" transmit "yes^M" wait 0:01:00 for "^Q" transmit "bye^M" wait 0:01:00 for "CONNECT" wait 0:00:05 hardexit
Also see the chapter “Qedit Issues and Solutions” for more information.