Click or drag to resize

GetFMask Function

X#
Prepare a file specification for wildcard searching.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION GetFMask(
	cString AS STRING
) AS STRING
Request Example 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#
1LOCAL cOrigin AS STRING
2LOCAL cSearch AS STRING
3cOrigin := "c:"
4cSearch := GetFMask(cOrigin)
5? cSearch                    // c:*.*
6Dir(cSearch)
7File(cSearch)
See Also