Or initialise each new cell to nil when the array is created/extended etc. Phil. ----- Original Message ----- From: "Stacey Verner" <[EMAIL PROTECTED]> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> Sent: Friday, September 10, 2004 7:41 AM Subject: RE: [DUG] How can I check if an object exists?
> Use a TList. > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Gajo Istvan > > Sent: Friday, 10 September 2004 6:24 > > To: [EMAIL PROTECTED] > > Subject: [DUG] How can I check if an object exists? > > > > > > Hi, > > I have an array of TObjects. A cell of the array may not have > > been created, so I want to check if it exists or not. This > > doesn't work: if myArray[i] = nil then ShowMessage('Object > > doesn't exist') > > > > What should I do? > > Gajo > > > > > > _______________________________________________ > > Delphi mailing list > > [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi > > > > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
