Roger Alcindor
asked on
Delphi code error not understood
I am a total novice regarding Delphi. I am trying to build a package for eventual use in a C++ builder project (in which language I am not a novice).
I am using code that I have found for using Smart cards.
the following code fragment generates an error and I need assistance to understand why and correct it.
I am using Embarcadero RAD Studio 10.2 enterprise edition
I am using code that I have found for using Smart cards.
the following code fragment generates an error and I need assistance to understand why and correct it.
I am using Embarcadero RAD Studio 10.2 enterprise edition
var
r : string;
a : integer;
begin
a := 1;
while a <= Length(Input) do
begin
case Input[a] of
#010 : if WantFormats then r := r + #10 else r := r + ' ';
#013 : if WantFormats then r := r + #13 else r := r + ' ';
#027 : if a < Length(Input) then
begin
Inc(a);
r := r + Extended[Ord(Input[a])+1];
end else r := r + ' ';
#128..#255 : ; {<<<<<<<<< This line gerates the error }
else r := r + Ascii[Ord(Input[a])+1];
end;
Inc(a);
end;
Result := r;
end;
gives the following error message
[dcc32 Error] GsmHelper.pas(551): E2011 Low bound exceeds high bound
might also depend on the definition of input
is it ansistring or string ?
is it ansistring or string ?
ASKER
The error still persists even when no reference to Input is made and only the case range is used as per the code shown below ?
var
r : string;
a : integer;
begin
a := 1;
while a <10 do//<= Length(Input) do
begin
case a of //Input[a] of
#128..#255 : ; {<<<<<<<<< This line gerates the error }
end;
Inc(a);
end;
Result := r;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for identifying the problem How far back in RAD Studio versions would I need to go to find that AnsiStrings did exist in Delphi ?
Not sure but think from 10.2 ... Event before it is not recommend to use, but starting from 10.2 - AnsiString is not recognized any more as such..
Here is more info ...
Here is more info ...
Open in new window