Lazarus
Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: typo on December 12, 2014, 03:04:12 pm
-
I am getting an external exception here:
var
Identifier :AnsiString;
DataType : array [0..DataTypesCount-1, 0..1] of PChar = (...);
begin
for n := 1 to DataTypesCount do
if Identifier = DataType[n, 0] then // EXCEPTION HERE
begin
{...}
end;
{...}
end;
The exception refers to a PChar to AnsiString conversion. Any idea?
-
Well, I solved it with a simple:
if PCHAR(Identifier) = DataType[n, 0] then
-
Attached is the converted project (64Kb).
-
Hello typo,
I see another bug in your code :
The intervals of the array and the loop are differents, respectively 0..DataTypesCount - 1 and 1..DataTypesCount.
-
Tnanks, but the code is not mine. I only converted it.