home *** CD-ROM | disk | FTP | other *** search
- /* find files
- Lotus WPD
- This REXX file performs a search of files matching the filespec and returns all hits into a list box
- Hdlg Ami Pro's handle to the custom dialog box, needed for setdlgitemtext
- Id Id of the listbox to set answers into
- Filespec something like d:\amipro\*.sam
- Text Text to locate
- Options Options for the search FO w/o subdirectories, FOS w/ subs
- */
-
- Arg Hdlg, Id, FileSpec, Text, Options
- call SysFileTree FileSpec,'FileName',Options
- count = FileName.0
- NumFound = 0
- Stat = SetDlgItemText(Hdlg, 8007, count)
- Stat = SetDlgItemText(Hdlg, 8009, count)
- do i = 1 to count
- File = filename.i
- If Text = ' ' then
- Stat = SetDlgItemText(Hdlg, id, File)
- Else do
- Call SysFileSearch text, file,'found'
- Target = found.0
- if Target > 0 then do
- Stat =SetDlgItemText(Hdlg, id, File)
- NumFound = NumFound+1
- Stat = SetDlgITemText(Hdlg, 8009, NumFound)
- End
- End
- End
- Return Count