Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-24 Thread Christos Chryssochoidis
On 23 Μαϊ 2007, at 3:05 ΜΜ, Tom Verhoeff wrote: On Wed, May 23, 2007 at 11:36:20AM +0300, Christos Chryssochoidis wrote: It *is* allowed. The only trick is that you have to declare a type for your dynamic array, i.e. you have to write something like Yes, I have noticed that if you

Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-24 Thread Tom Verhoeff
On Wed, May 23, 2007 at 05:48:32PM +0300, Christos Chryssochoidis wrote: On 23 Μαϊ 2007, at 3:05 ΜΜ, Tom Verhoeff wrote: It is not a trick, but has to do with type compatibility issues (and history, I guess). I see. If I understand well, Pascal uses some sort of declaration

[fpc-pascal] Dynamic array as return type of functions

2007-05-23 Thread Christos Chryssochoidis
Hi, I tried to write some function that returned a dynamic array, and realized that this isn't allowed. Why? After all one can specify an array of variable length as type for variables... Furthermore - if I'm not mistaken - a dynamic array is implemented internally as a pointer, and so

Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-23 Thread Michalis Kamburelis
Christos Chryssochoidis wrote: Hi, I tried to write some function that returned a dynamic array, and realized that this isn't allowed. Why? After all one can specify an array of variable length as type for variables... Furthermore - if I'm not mistaken - a dynamic array is implemented

Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-23 Thread Daniël Mantione
Op Wed, 23 May 2007, schreef Michalis Kamburelis: Christos Chryssochoidis wrote: Hi, I tried to write some function that returned a dynamic array, and realized that this isn't allowed. Why? After all one can specify an array of variable length as type for variables... Furthermore -

Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-23 Thread Christos Chryssochoidis
On 23 Μαϊ 2007, at 11:11 ΠΜ, Daniël Mantione wrote: Op Wed, 23 May 2007, schreef Michalis Kamburelis: Christos Chryssochoidis wrote: Hi, I tried to write some function that returned a dynamic array, and realized that this isn't allowed. Why? After all one can specify an array of variable