home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / ca24_1.zip / SCRIPTS.ZIP / DIRECTOR.CMD < prev    next >
OS/2 REXX Batch file  |  1988-05-13  |  1KB  |  55 lines

  1. ;
  2. ;    Perform a directory search
  3. ;
  4.     MESSAGE "^MEnter the wildcard template: "
  5.     GET S0            ; Read keyboard
  6. ;
  7. ;    Initialize the lookup
  8. ;
  9.     FFIRST S0        ; Initialize
  10.     IF Failure        ; If not found
  11.        MESS "No files match!"
  12.        EXIT         ; Quit here
  13.        ENDIF
  14.     LEGEND "Scripted wildcard file search"
  15. ;
  16. ;    Display the file names
  17. ;
  18. Loop_0:
  19.     N0 = 0            ; Set loop counter
  20. Loop_1:
  21.     FNEXT S0        ; Get next file name
  22.     IF Failure        ; If end of list
  23.        EXIT         ; Quit
  24.        ENDIF
  25. ;
  26. ;    Handle subdirectories
  27. ;
  28.     FATTR S1 S0        ; Get attribute
  29.     IF STRCMP S1(3:3) "1"   ; If a subdirectory
  30.        S0(13:79) = "<subdir>"
  31.        MESS S0        ; Display
  32.        GOTO End_Loop    ; Goto endloop
  33.        ENDIF
  34. ;
  35. ;    Get remaining information, format and print
  36. ;
  37.     FSIZE S1 S0        ; Get file size
  38.     FDATE S2 S0        ; Get file date
  39.     FTIME S3 S0        ; Get file time
  40.     S0(13:79) = S1        ; Set size
  41.     S0(21:79) = S2        ; Set date
  42.     S0(31:79) = S3        ; Set time
  43.     MESS S0         ; And display
  44. ;
  45. ;    After 23 lines, wait for a keypress
  46. ;
  47. End_Loop:
  48.     INC N0            ; Count the line
  49.     IF LT N0 23        ; If less than 23 lines printed
  50.        GOTO Loop_1        ; .. continue
  51.        ENDIF
  52.     MESS "Press any key to continue"
  53.     KEYGET S0        ; Wait for any key
  54.     GOTO Loop_0        ; And start a new screen
  55.