macros "FileSystem"
Code : Tout sélectionner
Macro FileExists(FileName)
(FileSize(FileName) >= 0 And #True)
EndMacro
Macro PathExists(PathName)
(FileSize(PathName) = -2 And #True)
EndMacro
Macro AddFileAttributes(File, Attributes)
SetFileAttributes(File, GetFileAttributes(File) | Attributes)
EndMacro
Macro RemFileAttributes(File, Attributes)
SetFileAttributes(File, GetFileAttributes(File) ! Attributes)
EndMacro
Macro HasFileAttributes(File, Attributes)
(((GetFileAttributes(File) & Attributes) <> 0) Or #False)
EndMacro
Code : Tout sélectionner
Macro IsUpper(c)
((c >= 'A') And (c <= 'Z'))
EndMacro
Macro IsLower(c)
((c >= 'a') And (c <= 'z'))
EndMacro
Macro IsAlpha(c)
(IsUpper(c) Or IsLower(c))
EndMacro
Macro IsDigit(c)
((c >= '0') And (c <= '9'))
EndMacro
Macro IsAlnum(c)
(IsAlpha(c) Or IsDigit(c))
EndMacro
Macro IsXDigit(c)
(IsDigit(c) Or ((c >= 'a') And (c <= 'f')) Or ((c >= 'A') And (c <= 'F')))
EndMacro
Macro IsPunct(c)
((c = '"') Or FindString("!#%&'();<=>?[\]*+,-./:^_{|}~", Chr(c), 1))
EndMacro
Macro IsGraph(c)
(IsAlnum(c) Or IsPunct(c))
EndMacro
Macro IsPrint(c)
((c = ' ') Or IsGraph(c))
EndMacro
Macro IsSpace(c)
((c = ' ') Or (c = #FF) Or (c = #LF) Or (c = #CR) Or (c = #HT) Or (c = #VT))
EndMacro
Macro IsBlank(c)
((c = ' ') Or (c = #TAB))
EndMacro
Macro IsCntrl(c)
((c = #BEL) Or (c = #BS))
EndMacro
Procedure.l IsNumeric(String.s)
Protected Numeric.l, *String.Character
If String
Numeric = #True
*String = @String
While Numeric And *String\c
Numeric = IsDigit(*String\c)
*String + SizeOf(Character)
Wend
EndIf
ProcedureReturn Numeric
EndProcedure