home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / a / amiga_vision_professional / amigavisionprofessiv2.04d.dms / in.adf / AVFileList.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1992-12-01  |  1.5 KB  |  95 lines

  1. /*    FileList    */
  2.  
  3.     n = addlib('rexxsupport.library',0,-30,0)
  4.  
  5.     address AV.REXX     /* Send commands to the AppGen ARexx port. */
  6.     options results     /* We want results back */
  7.  
  8.  
  9.     GETVAR resp
  10.     response = RESULT
  11.  
  12.     if ( response = "FileList" ) THEN
  13.     DO
  14.         'EVALUATE objget("FileList","ClickLine")'
  15.  
  16.         file = RESULT
  17.  
  18.         if ( file ~= "" ) THEN
  19.         DO
  20.             GETVAR CurrentDir
  21.             dir = RESULT
  22.  
  23.             if ( dir ~= "" ) THEN
  24.             DO
  25.                 path = dir||file
  26.  
  27.                 PARSE VALUE STATEF( path ) WITH type rest
  28.                 if ( type = 'DIR' ) THEN
  29.                 DO
  30.                     dir = path||'/'
  31.                     SETVAR CurrentDir dir
  32.  
  33.                     ScreenLock
  34.                     call UpDateFilesList()
  35.                     ScreenUnLock
  36.                 END
  37.                 ELSE DO
  38.                     GETVAR CurrentFile
  39.                     OldFile = RESULT
  40.  
  41.                     if ( file = OldFile ) THEN
  42.                         SETVAR DoubleClick TRUE
  43.                     ELSE
  44.                         SETVAR CurrentFile file
  45.                 END
  46.             END
  47.         END
  48.  
  49.     END
  50.  
  51.     ELSE if ( response = "VolumeList" ) THEN
  52.     DO
  53.         'EVALUATE CurrentDir = objget("VolumeList","ClickLine")'
  54.  
  55.         dir = RESULT
  56.  
  57.         if ( dir ~= "" ) THEN
  58.             call UpDateFilesList()
  59.     END
  60.  
  61.     exit
  62.  
  63.  
  64. UpDateFilesList:
  65.  
  66.         files = showdir( dir, 'F', '0a'x )
  67.         subdirs = showdir( dir, 'D', '0a'x )
  68.  
  69.         cur_file = 'ram:fr1.av'
  70.  
  71.         if ~ open( 'AVFILES', cur_file, 'w' ) THEN
  72.         DO
  73.             cur_file = 'ram:fr2.av'
  74.             if ~ open( 'AVFILES', cur_file, 'w' ) THEN
  75.                 exit
  76.         END
  77.  
  78.         if ( subdirs ~= "" ) THEN
  79.         DO
  80.             subdirs = '|H'||subdirs
  81.  
  82.             if ( files ~= "" ) THEN
  83.                 files = '|H'||files
  84.         END
  85.  
  86.         if ( subdirs ~= "" ) THEN
  87.             n = writeln( 'AVFILES', subdirs )
  88.  
  89.         n = writeln( 'AVFILES', files )
  90.         n = close( 'AVFILES' )
  91.  
  92.         "OBJSET FileList Filename" cur_file
  93.  
  94.         return
  95.