Neven,
>From a OO point of view, it makes sense to expose SQL as a TString instead
of TStringList. SQL can get by without the extensions that TStringList adds
to TStrings, eg. Sorting. Also, if Borland decided to change the internal
representation of SQL to, say, TSQLStrings, it won't break any code.
Furthermore, it seems like a standard for all VCL components to use TStrings
instead of the specific version - which also makes sense, because you don't
necessarily want to know about TListBoxStrings, etc. All you need to know
is how to deal with TStrings. Eg. code that populates a TQuery.SQL can be
reused to populate a TMemo to display the SQL text. It gives the components
a more consistent user interface - although there are plenty of places in
the VCL that is not consistent.
Regards,
Dennis.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Neven MacEwan
> Sent: Tuesday, 23 November 1999 14:28
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Why?
>
>
> Andrew
>
> Is this all so a common property editor can be used?
>
> Regards
> Neven
>
> ----- Original Message -----
> From: Cooke, Andrew <[EMAIL PROTECTED]>
> To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
> Sent: Tuesday, 23 November 1999 14:16
> Subject: RE: [DUG]: Why?
>
>
> > Because:
> > // Component def
> > published
> > property SQL: TStrings read FSQL write SetQuery;
> >
> > Now user code doesn't know if SQL is implemented using
> TStringList, or
> > another method (for instance, TListBox uses TListBoxStrings
> internally,
> but
> > exposes it consistently as TStrings).
> >
> > > -----Original Message-----
> > > From: Neven MacEwan [SMTP:[EMAIL PROTECTED]]
> > > Sent: Tuesday, November 23, 1999 2:05 PM
> > > To: Multiple recipients of list delphi
> > > Subject: [DUG]: Why?
> > >
> > > Hiya All
> > >
> > > For no other reason than It intrigues me but does anyone
> know why the
> VCL
> > > does this (from TQuery)
> > >
> > > // Component Def
> > > private
> > > FSQL: TStrings;
> > >
> > > // consructor
> > >
> > > constructor TQuery.Create(AOwner: TComponent);
> > > begin
> > > inherited Create(AOwner);
> > > FSQL := TStringList.Create;
> > > TStringList(SQL).OnChange := QueryChanged;
> > > ....
> > >
> > > why declare as TStrings when you want a TStringList?
> > >
> > > A mystery to me
> > >
> > > Regards
> > > Neven
> > >
> > >
> > >
> >
> >
> --------------------------------------------------------------
> ------------
> > > -
> > > New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> > > Website: http://www.delphi.org.nz
> >
> --------------------------------------------------------------
> ------------
> -
> > New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> > Website: http://www.delphi.org.nz
> >
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz