Is it possible to use dynamic arrays in gpc?

Waldek Hebisch hebisch at math.uni.wroc.pl
Tue Feb 5 16:52:31 CET 2008


Ohonin Yuriy wrote:
> I'm trying to use such a code:
> 
> type
> 	TVarList = object
> 		Items:array of TVar;
> 		count:cardinal;
> 		.....
> 	end;
> 
> In Delphi  and FPC it works fine, but in GPC i get an error
> 
> 45: warning: missing string capacity -- assuming 255
> 49: error: syntax error before `of'
> 
> Is it possible to use dynamic arrays in gpc?

gpc does not implement Delphi style dynamic arrays.  As Adriaan
wrote you can get very similar functionality using Extended
Pascal schema and pointers.  Of course Extended Pascal schema
have quite different syntax.  Also memory management is different:
with pointers to schema you must manually deallocate arrays.

-- 
                              Waldek Hebisch
hebisch at math.uni.wroc.pl 






More information about the Gpc mailing list