FileSpec.Find Method (Typed) | |
Search the disk for the file represented by this file specification, indicate if it exists, and if so, store its full path information in this file specification for future reference.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VOSystemClasses (in XSharp.VOSystemClasses.dll) Version: 2.21
Syntax VIRTUAL METHOD Find() AS LOGIC
public virtual bool Find()
Request Example
View SourceReturn Value
Type:
Logic
TRUE if the file was found; otherwise, FALSE.
Remarks
This method searches for the file subject to all the standard settings of the SetPath() and SetDefault() functions. If the file is found, its full path information is stored for future reference, which is useful since the initial search starts from the current directory and the same file can later be used in a DBServer, for example, when the current directory may not be the same.
Examples
The following example, part of a method in a hypothetical data window, defines a generic file, searches for it, and then displays its full path if found:
1oFileSpec := FileSpec{"custfile"}
2IF oFileSpec:Find()
3SELF:Caption := oFileSpec:FullPath d:\data\custfile.dbf
4...
5SELF:Use(DBServer{oFileSpec})
6ENDIF
See Also