[fpc-pascal] two questions about dynamic array

2013-03-13 Thread Xiangrong Fang
Hi All, I have two simple questions: 1) As far as I know class variables in FPC are automatic initialize to the NULL value (e.g. 0 or or whatever), does that include dynamic arrays? e.g. TMyClass = class myarray: array[0..100] of Integer; end; will myarray be initialized to nil? 2)

Re: [fpc-pascal] two questions about dynamic array

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address? It will be Nil. An equivalent alternative would be: MyArray := Nil; Regards, Sven ___ fpc-pascal maillist

Re: [fpc-pascal] two questions about dynamic array

2013-03-13 Thread Xiangrong Fang
2013/3/13 Sven Barth pascaldra...@googlemail.com Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address? It will be Nil. An equivalent alternative would be: MyArray := Nil; Sorry, I didn't see this

Re: [fpc-pascal] two questions about dynamic array

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:53 schrieb Xiangrong Fang xrf...@gmail.com: 2013/3/13 Sven Barth pascaldra...@googlemail.com Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address? It will be Nil. An equivalent