[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'sysutils' (#rtl) |
Check whether a string is a valid identifier name.
Source position: sysstrh.inc line 104
function IsValidIdent( |
const Ident: String |
):Boolean; |
IsValidIdent returns True if Ident can be used as a compoent 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.
No notes exist for this page yet.