home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus4 / ArexxScripts / psn-dpck.lha / DOpusPakken / Rexx / DevDetective.Rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-07-15  |  1.7 KB  |  69 lines

  1. /*
  2.  
  3. Template: ARexxPort/A, Device/A/M
  4.       Eg: DOPUS.1 PS0: PC0: DF0:
  5.  
  6. $VER: DevDetective.DOpus V1.0 (30-Jul-95) Allan 'Duff' Odgaard
  7. */
  8.  
  9. Call AddLib("rexxsupport.library",0,-30,0)
  10. If Show('p','DevDetectivePort') = 1 Then Exit
  11. OpenPort('DevDetectivePort')
  12.  
  13. Parse Arg PortName Dev.1 Dev.2 Dev.3 Dev.4 Dev.5 Dev.6 .
  14. If Show('p',PortName) = 0 Then Exit
  15.  
  16. Address(PortName)
  17. Options Results
  18. FailAt 21
  19.  
  20. Do n = 1 to 6
  21. If Dev.n = '' Then Signal Out
  22. Call Check(Dev.n)
  23. End
  24.  
  25. Out:    Close('DevDetectivePort')
  26.     Exit
  27.  
  28. Check:    Parse Arg Device
  29.     Address Command 'Info 'Device' >T:DevDetective.INF'
  30.  
  31.     Open('Info','T:DevDetective.INF','R')
  32.     a = ReadLn('Info');a = ReadLn('Info');a = ReadLn('Info')
  33.     InfoTxt = ReadLn('Info')
  34.     Close('Info')
  35.     Delete 'T:DevDetective.INF'
  36.  
  37.     InfoTxt = Right(InfoTxt,Length(InfoTxt)-10)
  38.     If InfoTxt = 'Unreadable disk' Then Return
  39.  
  40.     Status 3
  41.     ActiveWin = Result
  42.  
  43.     Status 13 ActiveWin
  44.     CurrentPath = Result
  45.  
  46.     Status 13 1-ActiveWin
  47.     OtherPath = Result
  48.  
  49.     If Left(CurrentPath,Length(Device)) = Device Then Status 13 ActiveWin Set Device
  50.     If Left(OtherPath,Length(Device)) = Device Then Status 13 1-ActiveWin Set Device
  51.  
  52.     If Left(CurrentPath,Length(Device)) = Device | Left(OtherPath,Length(Device)) = Device Then Return
  53.  
  54.     lf = '0a'x
  55.     Query ScreenName
  56.     PubScreen = Result
  57.  
  58.     Call AddLib("rexxreqtools.library",0,-30,0)
  59.     DOpusToFront
  60.     Busy On
  61.     Call rtezrequest("A new disk has been inserted in drive "Device || lf"Do you want to read this disk?","_Left Window|_Right Window|_Cancel","Directory Opus Request","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
  62.     Busy Off
  63.  
  64.     If RTResult = 0 Then Return
  65.     Status 3 Set RTResult-1
  66.     Status 13 RTResult-1 Set Device
  67.  
  68.     Return
  69.