Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A cursor to collect all files in a specific directory

Utility Program

A cursor to collect all files in a specific directory

by  ramani  Posted    (Edited  )
*********************************************************
** Author : Ramani (Subramanian.G)
** FoxAcc Software / Winners Software
** ramani_g@yahoo.com
** Type : Freeware with reservation to Copyrights
** Warranty : Nothing implied or explicit
** Last modified : 31 January, 2003
*********************************************************
** The following uses Filer.DLL and
** extracts all files in a directory as a cursor. [color blue]
*********************************************************
CREATE CURSOR filename (cfilename c(128))
omyfiler = CREATEOBJECT('Filer.FileUtil')
omyfiler.searchpath = 'C:\' && Search Directory
omyfiler.subfolder = 1 && 1=add all subdirectories else 0
oMyFiler.SortBy = 0
omyfiler.FIND(0)
LOCAL ncount
ncount = 1
FOR nfilecount = 1 TO omyfiler.FILES.COUNT
IF omyfiler.FILES.ITEM(nfilecount).NAME = "." OR ;
omyfiler.FILES.ITEM(nfilecount).NAME = ".."
LOOP
ENDIF
APPEND BLANK
REPLACE cfilename ;
WITH UPPER(omyfiler.FILES.ITEM(nfilecount).PATH)+ ;
UPPER(omyfiler.FILES.ITEM(nfilecount).NAME)
ENDFOR
BROW
**********************************************************
[/color]* EOF
*********************************************************
Evaluate this to make others know how useful is this
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top