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

  1. $!---------------------------------------------------------------------------
  2. $!                                                                           
  3. $!    wr  - procedure to download files from the vax to
  4. $!            a pc running Reflection.
  5. $!
  6. $!    input:     p1 - transfer type,
  7. $!           p2 - VAX file specification, wild cards permitted. PC
  8. $!            file names and extensions are formed by truncating
  9. $!            the vax filenames and extensions.
  10. $!           p3 - pc device and directory specification
  11. $!           p4 - value to reset disable-comp-code in Reflection       
  12. $!           p5 - delete?
  13. $!
  14. $!----------------------------------------------------------------------------
  15. $!
  16. $ set noon
  17. $!
  18. $ if p2.eqs."" then goto no_file_spec
  19. $! 
  20. $ esc[0,8] = %X1B
  21. $ esc_seq = esc  + "&oCRECEIVE "
  22. $ switch = ""
  23. $ if p1.nes."IMAGE" then goto loop
  24. $   switch = "/i"
  25. $   p1 = "BINARY"
  26. $!
  27. $ loop:
  28. $   vax_file = f$search(p2)
  29. $   if vax_file.eqs."" then goto no_files
  30. $   f_name = f$extract(0,8,f$parse(vax_file,,,"name"))
  31. $   f_type = f$extract(0,4,f$parse(vax_file,,,"type"))
  32. $   pc_file = p3 + f_name + f_type
  33. $   define $file 'vax_file               
  34. $   r2_command = esc_seq+pc_file+" from $file"+switch+" "+ p1 + " " + p5
  35. $   define sys$input sys$command
  36. $   write sys$output r2_command
  37. $   read/prompt="" sys$input host_startup_seq
  38. $   if host_startup_seq.eqs."F" then goto abort
  39. $   'host_startup_seq
  40. $   deassign sys$input                              
  41. $   read/prompt="" sys$command completion_code
  42. $   deassign $file
  43. $   if completion_code.nes."S" then goto abort
  44. $   goto loop
  45. $!
  46. $ no_files:
  47. $   goto exit
  48. $!
  49. $ no_file_spec:
  50. $   write sys$output "%ERROR - file specification parameter required!"
  51. $   goto exit
  52. $!
  53. $ abort:
  54. $   write sys$output "%ERROR - file transfer aborted in file " + vax_file
  55. $   goto exit
  56. $!
  57. $ exit:                                                    
  58. $   quote = """
  59. $   write sys$output esc + "&oCSET DISABLE-COMP-CODES " + p4
  60. $   if p4.eqs."YES" then goto done
  61. $     read /prompt="" sys$command completion_code
  62. $ done:
  63. $   exit
  64.