[fpc-pascal]Re: strange error - compilable code
vtech@fpc
vtech-fpc at seznam.cz
Wed Apr 16 21:38:40 CEST 2003
>Can you provided a compilable example that we can use for the test suite.
>Peter
Sure I can.
Vitek Kavan
{------------------------------------code_start----------------------------------------
This code produces following error:
Free Pascal Compiler version 1.1 [2003/04/08] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
test.pas(34,43) Error: call by var parameters have to match exactly: Got "Array Of TVertex3D" expected "Array Of TVertex3D"
test.pas(36) Fatal: There were 1 errors compiling module, stopping
Delphi is OK and it works:
Borland Delphi Version 14.0
Copyright (c) 1983,2002 Borland Software Corporation
test.pas(36)
37 lines, 0.03 seconds, 10756 bytes code, 1969 bytes data.
}
type
TVertex3D = record
x,y,z : single;
end;
var
Vertices1,Vertices2 : array of TVertex3D;
procedure TranslateArr(xc,yc,zc:single;var Src,Dst:array of TVertex3D;count:longint);
var i : longint;
begin
for i := 0 to count-1 do
begin
Dst[i].x := Src[i].x + xc;
Dst[i].y := Src[i].y + yc;
Dst[i].z := Src[i].z + zc;
end;
end;
begin
SetLength(Vertices1,1);
Vertices1[0].x := 3;
Vertices1[0].y := 2;
Vertices1[0].z := 1;
SetLength(Vertices2,1);
TranslateArr(5,3,-2,Vertices1,Vertices2,1);
end.
{------------------------------------code_end----------------------------------------}
More information about the fpc-pascal
mailing list