[lazarus] ANSISTRING expected TSTRINGS (trouble)

marius popa mapopa at reea.net
Sat Aug 31 15:57:20 EDT 2002


Now it works (the TstringLIST part)
Let's see if i can run a query ... (create Tdatabase a TTransaction  atach the query ...etc)
I begin to love lazarus :)

ps: the kylix 3 OE is out but is big mama :300Meg 
and have a bcb (c++) inside .


On Mon, 26 Aug 2002 00:22:02 +0200 (W. Europe Daylight Time)
Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:

> 
> 
> On Sun, 25 Aug 2002, marius popa wrote:
> 
> > i want to run next code (create a Tstrings and then transmit it to a query )
> >   tmpquery := TFIBQuery.Create(Self);
> >   mysql:=Tstrings.Create();
> >   mysql:='Select * from employee';     (*this is the line 152*)
> >   tmpquery.SetSQL(mysql);
> >
> > and this error kill me !!
> >
> > gtkfireadmin_main_form.pp(152,10) Error: Incompatible types: got "ANSISTRING" expected "TSTRINGS"
> >
> > but if i put this way (like in delphi )
> >
> >   tmpquery := TFIBQuery.Create(Self);
> >   mysql:=Tstrings.Create();
> 
> You cannot create an instance of TStrings, this is an abstract class.
> You must create a TStringList:
>  mysql:=TStringList.Create();
> 
> >   mysql.add('Select * from employee');
> >   tmpquery.SetSQL(mysql);
> >
> > then the program compiles ok but if i run the code (ex when i push a button)
> > the i have an AV (An unhandled exception occurred at 0x080BDFAC :
> > Abstract method called
> 
> This is where you see that the TStrings is abstract.
> Normally, the compiler warns you if you try to
> create abstract classes, so you should have had a warning.
> 
> Michael.
> 
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list