[fpc-pascal] Re: [fpc-pascal]Re: strange error - compilable code
Vit Kavan
vtech-fpc at seznam.cz
Thu Apr 17 18:03:58 CEST 2003
Uso FPC 1.1 ya, lee la mensaje del error. No quiero que usar punteros
aqui.
Oh gosh, my spanish sucks :-) Just look at the error from my original
message: "...Compiler version 1.1...". I'd really like to solve it
using dynamic arrays, as the Delphi code works well and I want to
keep it working (ie. minimize unnecessary changes).
> The FPC 1.06 don't support dynamic array,
> Use FPC 1.1 or use pointer.
>
> El compilador FPC 1.06 no soporta arreglos dinĂ¡micos
> Es mejor que uses FPC 1.1 o en todo caso usa punteros.
>
> >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-------------------------------
> ---------}
>
>
>
> --__--__--
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
> End of fpc-pascal Digest
>
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
______________________________________________________________________
Reklama:
PUPENDO - poselstvi budoucim generacim. V kinech od 27. brezna.
http://www.falcon.cz/film.asp?film=498
More information about the fpc-pascal
mailing list