Function Reference
_FO_CorrectMask
Returns the correct mask for the search for files or folders.
#Include <FileOperations.au3>
_FO_CorrectMask ( $sMask )
Parameters
$sMask | Mask contains valid characters in filenames and wildcards "*" and "?" and the delimiter "|" |
Return Value
Success: | Returns a correct mask |
Failure: | Returns the character "|" and @error=2 |
Remarks
Function corrects possible errors entered by the user:Related
_FO_FileSearch, _FO_FolderSearchExample
; AZJIO
; http://www.autoitscript.com/forum/topic/133224-filesearch-foldersearch/
#include <Array.au3> ; for _ArrayDisplay
#include <FileOperations.au3>
;=======================================
$timer = TimerInit()
$FolderList = _FO_FileSearch(@SystemDir, _FO_CorrectMask('|*.log|*.txt ..|*.avi.. |||*.log|*.bmp|*.log'))
$timer = Round(TimerDiff($timer) / 1000, 2) & ' sec'
_ArrayDisplay($FolderList, $timer & ' - with correction')
;=======================================
$FolderList = _FO_FileSearch(@SystemDir, _FO_CorrectMask('||||'))
If @error Then MsgBox(0, 'Message', '@error=' & @error)
;=======================================
MsgBox(0, '|*.log|*.txt ..|*.avi.. |||*.log|*.bmp|*.log', _FO_CorrectMask('|*.log|*.txt ..|*.avi.. |||*.log|*.bmp|*.log'))
MsgBox(0, '*.avi.. |*|*.log', _FO_CorrectMask('*.avi.. |*|*.log'))
$e = _FO_CorrectMask('|..| .. | |')
If @error Then MsgBox(0, '|..| .. | |', $e & ' - @error=' & @error)