home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / readdir.zip / READDIR.COM / READDIR.CLA < prev    next >
Text File  |  1989-12-19  |  3KB  |  116 lines

  1.          PROGRAM
  2.  
  3.          MAP
  4.            MODULE('READDIR'),BINARY
  5.          PROC(FINDFIRST)
  6.          PROC(FINDNEXT)
  7.          . .
  8.  
  9.  
  10. Screen         SCREEN      WINDOW(25,80),HUE(7,0),PRE(Scr)
  11.            ROW(1,6)      PAINT(25,70),HUE(7,1)
  12.          COL(6)      STRING('╔═{12}╤═{11}╤════<0{11}>'               |
  13.                 & '════╤═══╤═══╤═══╤═══╤═══╤═══╗'),ENH
  14.            ROW(2,6)      REPEAT(23)
  15.                 STRING('║<0{12}>│<0{11}>│<0{11}>│<0{7}>│<0{3}>'    |
  16.                 & '│<0{3}>│<0{3}>│<0{3}>│<0{3}>│<0{3}>║'),ENH .
  17.            ROW(25,6)  STRING('╚═{12}╧═{11}╧═{11}╧═{7}╧═══╧═══╧═══╧═══╧═══╧'|
  18.                 & '═══╝'),ENH
  19.            ROW(1,36)  STRING(' Directory '),HUE(0,3)
  20.            ROW(2,11)  STRING('Name'),HUE(11,1)
  21.          COL(24)  STRING('Size'),HUE(11,1)
  22.          COL(36)  STRING('Date'),HUE(11,1)
  23.          COL(46)  STRING('Time'),HUE(11,1)
  24.          COL(52)  STRING('R/O'),HUE(11,1)
  25.          COL(56)  STRING('Hid'),HUE(11,1)
  26.          COL(60)  STRING('Sys'),HUE(11,1)
  27.          COL(64)  STRING('Lbl'),HUE(11,1)
  28.          COL(68)  STRING('Dir'),HUE(11,1)
  29.          COL(72)  STRING('Arc'),HUE(11,1)
  30.               REPEAT(22),INDEX(Idx)
  31. FileName       ROW(3,7)        STRING(12)
  32. FileSize     COL(20)    STRING(@N11)
  33. Date         COL(32)    STRING(@D3)
  34. Time         COL(44)    STRING(@T3)
  35. ReadOnly     COL(53)    STRING(1)
  36. Hidden         COL(57)    STRING(1)
  37. System         COL(61)    STRING(1)
  38. Label         COL(65)    STRING(1)
  39. Directory     COL(69)    STRING(1)
  40. Archive         COL(73)    STRING(1)
  41.               .
  42.            ROW(25,35) PAUSE(' Press a key '),HUE(0,3)
  43.          .
  44.  
  45. DirEntry     GROUP,PRE(Dir)
  46. Attributes     GROUP
  47. ReadOnly     BYTE
  48. Hidden         BYTE
  49. System         BYTE
  50. Label         BYTE
  51. Directory     BYTE
  52. Archive         BYTE
  53.            .
  54. Time           LONG
  55. Date           LONG
  56. FileSize       LONG
  57. FileName       STRING(12)
  58.          .
  59.  
  60. Idx         BYTE
  61.  
  62.          CODE
  63.          OPEN(Screen)
  64.          Idx = 1
  65.          ALERT(0,999)
  66.          FindFirst('*.*', DirEntry)
  67.          LOOP UNTIL ERROR()
  68.            IF Idx = 23
  69.          ACCEPT
  70.          DO BlankIt
  71.          Idx = 1
  72.            .
  73.            DO ShowIt
  74.            FindNext(DirEntry)
  75.            Idx += 1
  76.          .
  77.          ACCEPT
  78.  
  79. BlankIt ROUTINE
  80.  
  81.   BLANK(ROW(Scr:FileName) ,COL(Scr:FileName) , 1, SIZE(Scr:FileName)  )
  82.   BLANK(ROW(Scr:FileSize) ,COL(Scr:FileSize) , 1, SIZE(Scr:FileSize)  )
  83.   BLANK(ROW(Scr:Date)      ,COL(Scr:Date)     , 1, SIZE(Scr:Date)      )
  84.   BLANK(ROW(Scr:Time)      ,COL(Scr:Time)     , 1, SIZE(Scr:Time)      )
  85.   BLANK(ROW(Scr:ReadOnly) ,COL(Scr:ReadOnly) , 1, SIZE(Scr:ReadOnly)  )
  86.   BLANK(ROW(Scr:Hidden)      ,COL(Scr:Hidden)   , 1, SIZE(Scr:Hidden)    )
  87.   BLANK(ROW(Scr:System)      ,COL(Scr:System)   , 1, SIZE(Scr:System)    )
  88.   BLANK(ROW(Scr:Label)      ,COL(Scr:Label)    , 1, SIZE(Scr:Label)     )
  89.   BLANK(ROW(Scr:Directory),COL(Scr:Directory), 1, SIZE(Scr:Directory) )
  90.   BLANK(ROW(Scr:Archive)  ,COL(Scr:Archive)  , 1, SIZE(Scr:Archive)   )
  91.  
  92. ShowIt ROUTINE
  93.  
  94.   Scr:FileName    = Dir:FileName
  95.   Scr:FileSize    = Dir:FileSize
  96.   Scr:Date    = Dir:Date
  97.   Scr:Time    = Dir:Time
  98.   IF Dir:ReadOnly
  99.     Scr:ReadOnly = '*'
  100.   .
  101.   IF Dir:Hidden
  102.     Scr:Hidden    = '*'
  103.   .
  104.   IF Dir:System
  105.     Scr:System    = '*'
  106.   .
  107.   IF Dir:Label
  108.     Scr:Label    = '*'
  109.   .
  110.   IF Dir:Directory
  111.     Scr:Directory = '*'
  112.   .
  113.   IF Dir:Archive
  114.     Scr:Archive = '*'
  115.   .
  116.