I am happy to be wrong. I believe the manual says it can / shouldn't be done.
Rob Martin Software Engineer phone 03 377 0495 fax 03 377 0496 web www.chreos.com Wild Software Ltd ----- Original Message ----- From: "Dennis Chuah" <[EMAIL PROTECTED]> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> Sent: Friday, September 17, 2004 3:18 PM Subject: Re: [DUG] TStringList.FList > Then I'm afraid RM is incorrect! This technique works on the principle that > the new class declares a memory footprint that is identical to TStringList. > What we are doing is casting the reference to the TStringList as the new > class and in the process, fooling the compiler into thinking that we are > accessing a genuine public member. > > > DC>THackedStringList = class(TStrings) > > public > > FList: PStringItemList; > > end; > > > > According to RM, this is not possible. I had already coded it this way > assuming it would work, but apparently only Protected members can be made > visible, not Private. > > ----- Original Message ----- > From: "Ross Levis" <[EMAIL PROTECTED]> > To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> > Sent: Friday, September 17, 2004 2:44 PM > Subject: Re: [DUG] TStringList.FList > > > RM> No its not possible to access private members without being in the same > pas. umm couldn't you just store an array of stringlist positions instead > or pointers to a string > > I can't store the Index positions because it's a sorted list and they will > change as more items are added. > > DC> Why can't you use at the Objects property? > > The Objects property is already being used, and anyway, this is referencing > in the wrong direction. I need a pointer to the string list not the other > way around. It's a plan I came up with to reduce memory requirements and > provide fast retrieval for upwards of 50,000 strings. > > DC>THackedStringList = class(TStrings) > public > FList: PStringItemList; > end; > > According to RM, this is not possible. I had already coded it this way > assuming it would work, but apparently only Protected members can be made > visible, not Private. > > Cheers, > Ross. > ----- Original Message ----- > From: Robert martin > To: NZ Borland Developers Group - Delphi List > Sent: Friday, September 17, 2004 2:20 PM > Subject: Re: [DUG] TStringList.FList > > > No its not possible to access private members without being in the same > pas. umm couldn't you just store an array of stringlist positions instead > or pointers to a string (not knowing what you are trying to do). > > I would look for other ways to implement your functionality or build your > own TStringList by copying the source out. Don't change classes. > > > > Rob Martin > Software Engineer > > phone 03 377 0495 > fax 03 377 0496 > web www.chreos.com > Wild Software Ltd > ----- Original Message ----- > From: Ross Levis > To: NZ Borland Developers Group - Delphi List > Sent: Friday, September 17, 2004 2:02 PM > Subject: [DUG] TStringList.FList > > > Is it possible to make visible a private variable in an ancestor class? > I need to obtain the pointer to the FList record array in a TStringList so I > can store the pointer to each string in the array. > > If not then I may be faced with modifying the Classes unit or taking a > copy of the TStringList code from the unit and making my own TStringList. > Any ideas? > > Cheers, > Ross. > > > -------------------------------------------------------------------------- -- > > > _______________________________________________ > 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 > > > _______________________________________________ > 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
