Click or drag to resize

GetFMask Function

Prepare a file specification for wildcard searching.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION GetFMask(
	cString AS STRING
) AS STRING
View Source

Parameters

cString
Type: String
The name of a drive and/or directory and/or file.

Return Value

Type: String
If <cString> ends with ":" or "\", the modified <cString> +"*.*" is returned; otherwise <cString> is returned.
Remarks
If <cString> ends with ":" or "\", indicating that <cString> is a drive or directory, "*.*" is added.  This enables searching through all files in the drive or directory specified.
Examples
This example uses GetFMask() to add a wild-card search to the arguments passed to Dir() and File().
X#
LOCAL cOrigin AS STRING
LOCAL cSearch AS STRING
cOrigin := "c:"
cSearch := GetFMask(cOrigin)
? cSearch                                        // c:*.*
Dir(cSearch)
File(cSearch)
See Also