home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d558 / btntape.lha / BTNtape / tape.rexx < prev    next >
OS/2 REXX Batch file  |  1991-10-28  |  1KB  |  43 lines

  1. /* TAPE.REXX:  Sends useful commands to tape drive via BTN handler.
  2.      R. Rethemeyer  8/91
  3. */
  4. address command
  5. default_drive = "TAPE"
  6.  
  7. arg cmd drive .
  8. if cmd=""   then signal helpme
  9. if drive="" then drive=default_drive
  10.  
  11. select
  12.    when abbrev("REWIND",cmd,3)    then edata="01"
  13.    when abbrev("RETENSION",cmd,3) then edata="1B 00 00 00 03 00"
  14.    when abbrev("END",cmd,3)       then edata="11 03"
  15.    when abbrev("WFM",cmd,3)       then edata="10 00 00 00 01"
  16.    when abbrev("FORWARD",cmd,1)   then edata="11 01 00 00 01"
  17.    when abbrev("BACKWARD",cmd,1)  then do
  18.          'echo >'drive':RAWCMD "11 01 FF FF FE"'  /* 2 steps back */
  19.          edata="11 01 00 00 01"                   /* 1 step forward */
  20.          end
  21.    when abbrev("ERASE",cmd,3)     then do
  22.          say "Are you SURE you want to erase" drive "? (y/n)"
  23.          pull huh .
  24.          if substr(huh,1,1)~="Y" then signal byebye
  25.          'echo >'drive':RAWCMD "01"'  /* rewind first */
  26.          edata="19 01"
  27.          end
  28.    otherwise signal helpme
  29. end
  30.  
  31. 'echo >'drive':RAWCMD "'edata'"'
  32.  
  33. byebye:
  34. exit
  35.  
  36. helpme:
  37.    say "Syntax:   [RX] TAPE <function> [device]"
  38.    say " function is one of:"
  39.    say "   REWind, RETension, ERAse, WFM, END (skip to end of data),"
  40.    say "   FORward (skip forward 1 file), BACK (skip back 1 file)."
  41.    say " If omitted, device defaults to TAPE"
  42.    exit
  43.