home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / REFLECT.ZIP / DEMO2.DCL < prev    next >
Encoding:
Text File  |  1989-02-14  |  3.2 KB  |  85 lines

  1. $! DEMO2.DCL          HOST CONTROL OF REFLECTION
  2. $!
  3. $! This file, once transferred to the VAX, must be renamed changing the
  4. $! .DCL extension to a .COM extension.
  5. $!
  6. $! This command procedure demonstrates host control of Reflection using command
  7. $! language.  All commands in the Reflection command language can be initiated
  8. $! by the host with the following escape sequence:
  9. $!
  10. $! Esc&oC<command><carriage return>
  11. $!
  12. $! Simple commands such as DIR and TYPE can be sent, as well as all the file
  13. $! transfer commands including the XMODEM and KERMIT.  In addition, you can
  14. $! invoke a file on the PC as a Reflection command file, and you can even send
  15. $! the SHELL command to start up an MSDOS batch file from within Reflection.
  16. $!
  17. $! Reflection completion codes are used for synchronization.  Completion codes
  18. $! are enabled with the command "set disable-comp-codes no".  When a host
  19. $! initiated command completes, Reflection sends back either an S for success
  20. $! or F for failure.
  21. $!
  22. $! When the user starts a file transfer from the file transfer menu or with the
  23. $! SEND and RECEIVE commands, Reflection always sends the "host startup
  24. $! sequence".  For host-initiated transfers, the host program must read the
  25. $! "host startup sequence".  Otherwise this sequence may interfere with the
  26. $! transfer.
  27. $!
  28. $! Set up the escape sequence and use the Reflection SET command to configure
  29. $! completion codes and startup sequence.
  30. $!
  31. $ESC[0,32]=%X1B
  32. $ESCSEQ=ESC+"&oC"
  33. $WRITE SYS$OUTPUT ESCSEQ+"set disable-comp-codes no"
  34. $READ/PROMPT="" SYS$COMMAND COMPLETION_CODE
  35. $WRITE SYS$OUTPUT ESCSEQ+"set host-startup ""RUN VAXLINK"""
  36. $READ/PROMPT="" SYS$COMMAND COMPLETION_CODE
  37. $!
  38. $! Get a command from the user. If the command is SEND, RECEIVE, BACKUP, or
  39. $! RESTORE then go run VAXLINK.EXE.
  40. $!
  41. $LOOP:
  42. $  INQUIRE COMMAND "Enter a Reflection command (CR to exit)"
  43. $  IF F$LENGTH(COMMAND) .EQ. 0 THEN EXIT
  44. $  CMD = F$EXTRACT(0,4,COMMAND)
  45. $  IF CMD .EQS. "SEND" THEN GOTO START_VAXLINK
  46. $  IF CMD .EQS. "RECE" THEN GOTO START_VAXLINK
  47. $  IF CMD .EQS. "BACK" THEN GOTO START_VAXLINK
  48. $  IF CMD .EQS. "REST" THEN GOTO START_VAXLINK
  49. $!
  50. $! Send complete command to Reflection.
  51. $!
  52. $  WRITE SYS$OUTPUT ESCSEQ+COMMAND
  53. $!
  54. $! Read the completion code
  55. $!
  56. $READ_CC:
  57. $  READ/PROMPT="" SYS$COMMAND COMPLETION_CODE
  58. $  IF COMPLETION_CODE .NES. "S" THEN GOTO BAD_COMMAND
  59. $  WRITE SYS$OUTPUT "Successful command"
  60. $  GOTO LOOP
  61. $BAD_COMMAND:
  62. $  WRITE SYS$OUTPUT "Invalid command"
  63. $  GOTO LOOP
  64. $!
  65. $!  1. Start the PC end of the file transfer.
  66. $!  2. Read the host startup sequence.    If its not what we expect then
  67. $!     go to bad_command.
  68. $!  3. Run VAXLINK to start the host end of the file transfer.
  69. $!  4. If this is a RESTORE command run VAXLINK again.
  70. $!  5. Go check completion code.
  71. $!
  72. $START_VAXLINK:
  73. $  WRITE SYS$OUTPUT ESCSEQ+COMMAND
  74. $  READ/PROMPT="" SYS$COMMAND HOST_STARTUP
  75. $  IF HOST_STARTUP .NES. "RUN VAXLINK" THEN GOTO BAD_COMMAND
  76. $  DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  77. $  RUN VAXLINK
  78. $  IF CMD .NES. "REST" THEN GOTO READ_CC
  79. $  READ/PROMPT="" SYS$COMMAND HOST_STARTUP
  80. $  IF HOST_STARTUP .NES. "RUN VAXLINK" THEN GOTO BAD_COMMAND
  81. $  DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  82. $  RUN VAXLINK
  83. $  GOTO READ_CC
  84.  
  85.