Wildcards are characters which can be used in a filename as a template to select a group of files to be operated upon. A filename with wildcard characters in it will be compared with existing filenames using special rules and all filenames that "match" are acted upon. It is necessary in HP BASIC/WS to support wildcards in many commands since no operating system is available. Under HTBasic, wildcards can be used directly in operating system commands using theEXECUTEstatement. However for convenience, wildcards are supported in theCATstatement.
The question mark "?" and the asterisk "*" are the wildcard characters. If theWILDCARDSstatement is executed it will return an error because wildcarding is always on.SYSTEM$("WILDCARDS") always returns "ON:". Wildcarding never needs to be turned off because the wildcard characters are not legal filename characters.
These are the rules used to match an actual filename with wildcards:
1. The "?" character will match any one character in the same position of an actual filename. For example, the string "?AT" will match the strings "CAT", "BAT", "MAT" or any other string three letters long which has an "A" as the second letter and "T" as the third letter.
2. The "*" character will match zero or more characters. For example, "*" will match all filenames. "F*" will match all filenames starting with the letter "F". "*.BAS" will match all filenames which have the ".BAS" extension.
FAT file systems with long file names exhibit an unexpected behavior. If the wildcards match either the 8.3 name or the long name, the file is considered to match. The state ofCONFIGURE LONGFILENAMEShas no effect.