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

  1. continue on
  2. ;
  3. ; initialize variables
  4. ;
  5. let v0 = 0
  6. let v7 = value(disable-comp-codes)
  7. let v1 = UPPER(v1)
  8. let v2 = UPPER(v2)
  9. let v3 = UPPER(v3)
  10. let v4 = UPPER(v4)
  11. let v5 = UPPER(v5)
  12. set disable-comp-codes NO
  13. ;
  14. ;    count parameters
  15. ;
  16. let v0 = 0
  17. if v1 = ""
  18.    let v2 = ""
  19.    let v3 = ""
  20.    let v4 = ""
  21.    let v5 = ""
  22.    goto parse
  23. endif
  24. let v0 = 1
  25. if v2 = ""
  26.    let v3 = ""
  27.    let v4 = ""
  28.    let v5 = ""
  29.    goto parse
  30. endif
  31. let v0 = 2
  32. if v3 = ""
  33.    let v4 = ""
  34.    let v5 = ""
  35.    goto parse
  36. endif
  37. let v0 = 3
  38. if v4 = ""
  39.    let v5 = ""
  40.    goto parse
  41. endif
  42. let v0 = 4
  43. if v5 = ""
  44.    goto parse
  45. endif
  46. let v0 = 5
  47. if v6 = ""
  48.    goto parse
  49. endif
  50. let v0 = 9
  51. ;
  52. ; parse command
  53. ;
  54. :parse
  55. let v6 = value(literal-escape)
  56. set literal-escape "||"
  57. ;
  58. if v0<1
  59.   display "^m^j%ERROR - file specification parameter required.^m^j"
  60.   goto error
  61. endif
  62. if v0>5
  63.   display "^m^j%ERROR - too many parameters.^m^j"
  64.   goto error
  65. endif
  66. if v2 = "FROM"
  67.   let v2 = v3
  68. else
  69.   let v4 = v2
  70.   let v5 = v3
  71.   let v2 = v1
  72.   let v1 = ""
  73. endif
  74. if v4 = "DELETE"
  75.    let v4 = v5
  76.    let v5 = "DELETE"
  77. endif
  78. if v4 = ""
  79.    let v4 = 'ASCII'
  80. else
  81.   if (v4<>'ASCII') and (v4<>'BINARY') and (v4<>'IMAGE')
  82.     display "^m^j%ERROR - type '$4', valid types; ASCII, BINARY or IMAGE.^m^j"
  83.     goto error
  84.   endif
  85. endif
  86. if v5<>"DELETE"
  87.   if v5 = ""
  88.     let v5 = '""'
  89.   else
  90.     display "^m^j%ERROR - invalid option - '$5'.^m^j"
  91.     goto error
  92.   endif
  93. endif
  94. ;
  95. ;  does the directory errors?
  96. ;
  97. if v1 <> ""
  98.    let v9 = length(v1)
  99.    if mid(v1,v9,v9) <> '\'
  100.       let v1 = v1 & '\'
  101.    endif
  102.    let v9 = v1 & '-_-_-_-_.-_-'
  103.    open $9 output as 1
  104.    let v8 = error-code
  105.    if (v8>0) and (v8<>18)
  106.      display "^m^j%ERROR - invalid directory " & v1 & ".^m^j"
  107.      goto error
  108.    endif
  109.    if v8<>18
  110.      close 1
  111.      del $9
  112.    endif
  113. else
  114.   let v1 = '""'
  115. endif
  116. ;
  117. ;  start transfer
  118. ;
  119. transmit '@wr $4 $2 $1 $7 $5 ^m'
  120. set literal-escape "$6$6"
  121. continue off
  122. :exit
  123. stop
  124. ;
  125. ; error
  126. ;
  127. :error
  128. set disable-comp-codes $7
  129. goto exit
  130.