[fpc-pascal]Two simple dynamic arrays questions

Cox, Stuart TRAN:EX Stuart.Cox at gems1.gov.bc.ca
Wed Jul 28 21:22:10 CEST 2004


Would not allocating the dynamic arrays a single element greater in size not
permit you to address their elements the way you'd like. 
I.e.: for a five element array, allocate size 6 and get [0..5] and then use
only [1..5]?  Just pretend that the [0] position doesn't exist.
Of Course, you'd have to be careful with low(x) as the index starting spot.
If this is too easy what am I missing?

Stu

-----Original Message-----
From: fpc-pascal-admin at lists.freepascal.org
[mailto:fpc-pascal-admin at lists.freepascal.org] On Behalf Of Jonas Maebe
Sent: Wednesday, July 28, 2004 12:00 PM
To: fpc-pascal at lists.freepascal.org
Subject: Re: [fpc-pascal]Two simple dynamic arrays questions



On 28 jul 2004, at 19:48, Alan Mead wrote:

> (1) Previously, I had fillchar'd the static arrays with zeros because 
> they are sparse-ish.  Looks like dynamic arrays are automagically 
> filled with zeros.  Is this true/permanent?

Yes.

> (2) There is no way, I supposed, to switch the array indexes to start 
> at 1 is there?

No, there is unfortunately no way to do this.


Jonas


_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list