Hello, I am trialling Elements, the following does not seem to compile when Delphi Compatibility is turned on:
function IsValidIdent(const Ident: string; AllowDots: Boolean): Boolean;
const
Alpha = [‘A’…‘Z’, ‘a’…‘z’, ‘_’];
AlphaNumeric = Alpha + [‘0’…‘9’];
AlphaNumericDot = AlphaNumeric + [’.’];
var
I: Integer;
begin
Result := False;
if (length(Ident) = 0) or not (Ident[1] in Alpha) then Exit;
if AllowDots then
for I := 2 to length(Ident) do
begin
if not (Ident[I] in AlphaNumericDot) then Exit
end
else
for I := 2 to length(Ident) do
if not (Ident[I] in AlphaNumeric) then Exit;
Result := True;
end;
I get a “Type Mismatch” error on Alpha + [‘0’…‘9’]