Forum > General

Array of array of array problem...

(1/2) > >>

Fred vS:
Hello.
I have some trouble with array :


--- Code: ---type
...
  TDArFloat = array of cfloat;
   TDArPARFloat = array of TDArFloat;
  TDArIARFloat = array of TDArPARFloat; 

....
var
mymultiarray : TDArIARFloat ;
 
--- End code ---

When i use that code with fpc 2.7.1 => perfect, no problem :

--- Code: --- setlength(mymultiarray,1) ;
 setlength(mymultiarray[0], 1) ;
  setlength(mymultiarray[0].[0],1) ;
 
--- End code ---

But with fpc 2.6.2 i have that error  message :

--- Quote --- setlength(mymultiarray[0].[0],1)
 Error: Illegal qualifier

--- End quote ---

What must i do to be fpc 2.6/2.7 compatible ?

Many thanks.

Fred

engkin:
Maybe SetLength(mymultiarray[0, 0], 1);?

Fred vS:

--- Code: ---SetLength(mymultiarray[0, 0], 1);
--- End code ---
=>

--- Quote --- Error: Incompatible types: got "Set Of Byte" expected "Int64"

--- End quote ---

engkin:
From an example from the docs:
SetLength(mymultiarray, 1, 1, 1);

Fred vS:
@ engkin : Many thanks.

Aaargh, lot of code to change and...
 with SetLength(mymultiarray, 1, 1, 1), it set length for each array.
With the fpc 2.7.1 syntax, you can set only the length of last array.

Or maybe does it exist something like : SetLength(mymultiarray, -1, -1, 3) but i do not find it in doc  ;)

Navigation

[0] Message Index

[#] Next page

Go to full version