home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / sys / Rexx / FastJPEG.rexx next >
OS/2 REXX Batch file  |  1994-06-22  |  2KB  |  80 lines

  1. /*                                                         */
  2. /*               $VER: FastJPEG 1.0 (21.6.94)              */
  3. /*                                                         */
  4. /* checks for AGA or ECS and calls FJPEG_AGA or FJPEG_ECS  */
  5. /*              (C) 1994 by Bernhard Möllemann             */
  6. /* distribution is allowed only on the CD "Meeting Pearls" */
  7.  
  8. parse arg line
  9.  
  10. Address Command
  11. Options Results
  12.  
  13. /* Trace R */
  14.  
  15. ccres=CheckChips(AGA)
  16.  
  17. if ( ccres>=5 ) then
  18.   'FJPEG_ECS 'line
  19. else
  20.   'FJPEG_AGA 'line
  21.  
  22. return
  23.  
  24.  
  25. Procedure: CheckChips
  26.  
  27. if ( Find(line,'AGA') ) then
  28.   lookforchip='AGA'
  29. else if Find(line,'ECS') then
  30.   lookforchip='ECS'
  31. else if ( line~='' ) then do
  32.   say "can not check for "line
  33.   return 10
  34. end; else
  35.   lookforchip=''
  36.  
  37. retval=0;
  38. if ( lookforchip~='' ) then do
  39.  
  40.   'ShowConfig >T:__scout_'Pragma('I')
  41.   if ( RC~=0 ) then do
  42.     say "ShowConfig not found"
  43.     return 10
  44.   end
  45.  
  46.   if ( Open(scout,'T:__scout_'Pragma('I'),'R') ) then do
  47.     do while ( eof(scout)=0 )
  48.       ln=readln(scout)
  49.       select
  50.         when ( Left(ln,13)='CUSTOM CHIPS:' ) then do
  51.           haschip=0
  52.           select
  53.             when ( lookforchip='AGA' & Index(ln,'AGA')>0) then
  54.               haschip=1
  55.  
  56.             when ( lookforchip='ECS' & ( Index(ln,'AGA')>0 | Index(ln,'ECS')>0 ) ) then
  57.               haschip=1
  58.  
  59.             otherwise ;
  60.           end
  61.  
  62.           if ( ~haschip ) then
  63.             retval=5
  64.  
  65.         end
  66.  
  67.         otherwise ;
  68.       end
  69.     end
  70.     call Close(scout)
  71.     'Delete T:__scout_'Pragma('I')' QUIET'
  72.   end; else do
  73.     say "can not open tmpfile"
  74.     return 10
  75.   end
  76. end
  77.  
  78. return retval
  79.  
  80.