[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Check whether a string is a valid identifier name.
Source position: sysstrh.inc line 114
function IsValidIdent( |
const Ident: string; |
AllowDots: Boolean = False; |
StrictDots: Boolean = False |
):Boolean; |
IsValidIdent returns True if Ident can be used as a component name. It returns False otherwise. Ident must consist of a letter or underscore, followed by a combination of letters, numbers or underscores to be a valid identifier.
None.
Program Example75; { This program demonstrates the IsValidIdent function } Uses sysutils; Procedure Testit (S : String); begin Write ('"',S,'" is '); If not IsVAlidIdent(S) then Write('NOT '); Writeln ('a valid identifier'); end; Begin Testit ('_MyObj'); Testit ('My__Obj1'); Testit ('My_1_Obj'); Testit ('1MyObject'); Testit ('My@Object'); Testit ('M123'); End.