[fpc-pascal] Initializing dynamic arrays

2012-06-04 Thread ingemar
I am writing a unit for dealing with matrix algebra with arbitrary sized matrices (as opposed to the FPC unit that deals with a few fixed size ones). I declare the matrix type type Matrix = array of array of Real; By using Length or High, I can loop through the array as I please, and I

Re: [fpc-pascal] Initializing dynamic arrays

2012-06-04 Thread Jonas Maebe
ingemar wrote on Mon, 04 Jun 2012: There is just one thing that I can't do: I can't initialize a matrix in any elegant way! I would like to do like this: m1: Matrix = ((1, 2, 3), (2, 3, 4)); and get a properly sized dynamic array matching the matrix given. This is obviously not

Re: [fpc-pascal] Initializing dynamic arrays

2012-06-04 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: m1: Matrix = ((1, 2, 3), (2, 3, 4)); and get a properly sized dynamic array matching the matrix given. This is obviously not supported, but what can I do? I can build an infinite number of functions, taking fixed-sized arrays as input and

Re: [fpc-pascal] Initializing dynamic arrays

2012-06-04 Thread Paulo Costa
On 04/06/2012 13:51, inge...@ragnemalm.se wrote: I am writing a unit for dealing with matrix algebra with arbitrary sized matrices (as opposed to the FPC unit that deals with a few fixed size ones). If you are writing that for your fun and to learn, go ahead, if what you really want is to