home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 14 / 14.iso / s / s005 / 52.ddi / SAMPMAC.LIB / REXXFIND.CMD < prev    next >
Encoding:
Text File  |  1993-09-11  |  934 b   |  31 lines

  1. /* find files
  2. Lotus WPD
  3. This REXX file performs a search of  files matching the filespec and returns all hits into a list box
  4. Hdlg        Ami Pro's handle to the custom dialog box, needed for setdlgitemtext
  5. Id        Id of the listbox to set answers into
  6. Filespec        something like d:\amipro\*.sam
  7. Text        Text to locate
  8. Options        Options for the search FO w/o subdirectories, FOS w/ subs
  9. */
  10.  
  11. Arg Hdlg, Id, FileSpec, Text, Options
  12. call SysFileTree FileSpec,'FileName',Options
  13. count = FileName.0
  14. NumFound = 0
  15. Stat = SetDlgItemText(Hdlg, 8007, count)
  16. Stat = SetDlgItemText(Hdlg, 8009, count)
  17. do i = 1 to count
  18.     File = filename.i
  19.     If Text = ' ' then 
  20.         Stat = SetDlgItemText(Hdlg, id, File)
  21.     Else do
  22.         Call SysFileSearch text, file,'found'
  23.         Target = found.0
  24.         if Target > 0 then do
  25.             Stat =SetDlgItemText(Hdlg, id, File) 
  26.             NumFound = NumFound+1
  27.             Stat = SetDlgITemText(Hdlg, 8009, NumFound)
  28.         End
  29.     End
  30. End
  31. Return Count