Navigation:  Reference > Functions >

FindFile()

Print this Topic Previous pageReturn to chapter overviewNext page

 

FFILE(1,2)

 

PURPOSE

This function searches for and returns the name of a file if found.

 

PARTS

 

1 f/c/eRequired - The file to search for.  You may use the standard wildcard file search characters of * and ?.

 

2 f/c/eWhether to search for the first occurrence of the file or the next.  'F' searches for the first, 'N' for the next.  The default value is 'F'.

 

RETURN TYPE - A

Returns the file name if found.  If the file is not found a blank field ("") will be returned.  If the receiving field is too short the returning value will be truncated.

 

COMMENTS

You can search for an entire group of files that match a certain pattern.  The first time you search part 2 must be set to 'F'.  For any searches after that, part 2 must be set to 'N'.  When no more matches are found the file name returned will be blank ("").  Part 1 is not consequential when Part 2 is set to 'N'.  However, a null field ("") at least must be included as a space keeper.

 

You must include the path if the file being searched for isn't in the current path.  However, the file name returned will not include any path value, only the name and extension.

 

SEE ALSO

FILE_EXISTS() DIR_EXISTS()

 

EXAMPLE

define x type a size 250

x = FFILE('D*.*','F')

// x might contain a value similar to: 'DICTDAT.B' or 'DATABASE.DAT' etc.

 

x = FFILE('D??DAT.B','F')

// x might contain a value similar to: 'DBCDAT.B' or 'D12DAT.B' etc.

 

 


Page url: http://www.cassoftware.com/tas/manual/findfile().htm