home *** CD-ROM | disk | FTP | other *** search
- $! DEMO2.DCL HOST CONTROL OF REFLECTION
- $!
- $! This file, once transferred to the VAX, must be renamed changing the
- $! .DCL extension to a .COM extension.
- $!
- $! This command procedure demonstrates host control of Reflection using command
- $! language. All commands in the Reflection command language can be initiated
- $! by the host with the following escape sequence:
- $!
- $! Esc&oC<command><carriage return>
- $!
- $! Simple commands such as DIR and TYPE can be sent, as well as all the file
- $! transfer commands including the XMODEM and KERMIT. In addition, you can
- $! invoke a file on the PC as a Reflection command file, and you can even send
- $! the SHELL command to start up an MSDOS batch file from within Reflection.
- $!
- $! Reflection completion codes are used for synchronization. Completion codes
- $! are enabled with the command "set disable-comp-codes no". When a host
- $! initiated command completes, Reflection sends back either an S for success
- $! or F for failure.
- $!
- $! When the user starts a file transfer from the file transfer menu or with the
- $! SEND and RECEIVE commands, Reflection always sends the "host startup
- $! sequence". For host-initiated transfers, the host program must read the
- $! "host startup sequence". Otherwise this sequence may interfere with the
- $! transfer.
- $!
- $! Set up the escape sequence and use the Reflection SET command to configure
- $! completion codes and startup sequence.
- $!
- $ESC[0,32]=%X1B
- $ESCSEQ=ESC+"&oC"
- $WRITE SYS$OUTPUT ESCSEQ+"set disable-comp-codes no"
- $READ/PROMPT="" SYS$COMMAND COMPLETION_CODE
- $WRITE SYS$OUTPUT ESCSEQ+"set host-startup ""RUN VAXLINK"""
- $READ/PROMPT="" SYS$COMMAND COMPLETION_CODE
- $!
- $! Get a command from the user. If the command is SEND, RECEIVE, BACKUP, or
- $! RESTORE then go run VAXLINK.EXE.
- $!
- $LOOP:
- $ INQUIRE COMMAND "Enter a Reflection command (CR to exit)"
- $ IF F$LENGTH(COMMAND) .EQ. 0 THEN EXIT
- $ CMD = F$EXTRACT(0,4,COMMAND)
- $ IF CMD .EQS. "SEND" THEN GOTO START_VAXLINK
- $ IF CMD .EQS. "RECE" THEN GOTO START_VAXLINK
- $ IF CMD .EQS. "BACK" THEN GOTO START_VAXLINK
- $ IF CMD .EQS. "REST" THEN GOTO START_VAXLINK
- $!
- $! Send complete command to Reflection.
- $!
- $ WRITE SYS$OUTPUT ESCSEQ+COMMAND
- $!
- $! Read the completion code
- $!
- $READ_CC:
- $ READ/PROMPT="" SYS$COMMAND COMPLETION_CODE
- $ IF COMPLETION_CODE .NES. "S" THEN GOTO BAD_COMMAND
- $ WRITE SYS$OUTPUT "Successful command"
- $ GOTO LOOP
- $BAD_COMMAND:
- $ WRITE SYS$OUTPUT "Invalid command"
- $ GOTO LOOP
- $!
- $! 1. Start the PC end of the file transfer.
- $! 2. Read the host startup sequence. If its not what we expect then
- $! go to bad_command.
- $! 3. Run VAXLINK to start the host end of the file transfer.
- $! 4. If this is a RESTORE command run VAXLINK again.
- $! 5. Go check completion code.
- $!
- $START_VAXLINK:
- $ WRITE SYS$OUTPUT ESCSEQ+COMMAND
- $ READ/PROMPT="" SYS$COMMAND HOST_STARTUP
- $ IF HOST_STARTUP .NES. "RUN VAXLINK" THEN GOTO BAD_COMMAND
- $ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
- $ RUN VAXLINK
- $ IF CMD .NES. "REST" THEN GOTO READ_CC
- $ READ/PROMPT="" SYS$COMMAND HOST_STARTUP
- $ IF HOST_STARTUP .NES. "RUN VAXLINK" THEN GOTO BAD_COMMAND
- $ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
- $ RUN VAXLINK
- $ GOTO READ_CC
-