Forum: Object-Pascal / Delphi-Language
Delphi
by DeddyH,
19. Sep 2011
And what about ctoi('Z')?
Forum: Object-Pascal / Delphi-Language
Delphi
by DeddyH,
19. Sep 2011
I tried to translate the two posted functions:
function ctoi(source: char): integer;
begin
if (source >= '0') and (source <= '9') then
Result := Ord(source) - Ord('0')
else
Result := Ord(source) - Ord('A') + 10;
end;
function itoc(source: integer): char;
Forum: Object-Pascal / Delphi-Language
Delphi
by DeddyH,
18. Sep 2011
Since we cannot know the type of Data, here are 2 suggestions:
//If Data is a string:
i := 1;
while i < Length(Data) do
//If Data is a dynamic array of Char:
i := 0;
while i < High(Data) do
//Anyway, I hope this is right in both cases: