[yunqa.de] Re: Newbie still struglling with DISQLite 3

  • From: "dogo" <dogo_daz@xxxxxxx>
  • To: <yunqa@xxxxxxxxxxxxx>
  • Date: Fri, 11 Jul 2008 17:11:40 +0100

Hi,

I've been playing with the stringlist demo, and have modified it a bit.. No
doubt I have made it Worst :-( what I am now trying to do is match the text
from the edit1.textbox to an item in my string list, but I am having no luck
could someone point me in the right direction.  

Cheers and sorry for all the questions

Darren

procedure TfrmStringList.btnSelectClick(Sender: TObject);
const
  SelectSQL = 'SELECT * from aircraft';
var
  Stmt: TDISQLite3Statement;
  i: Integer;
begin
  MyStringList := TStringList.Create;

                                   //
  try
    MyStringList.Delimiter := ',';
    Stmt := FDatabase.Prepare16(SelectSQL);
    try

      while Stmt.Step = SQLITE_ROW do
      begin
        MyStringList.AddObject(Stmt.Column_Str16(3), // The Name.
          TObject(Stmt.Column_Int(0))); // The ID, stored as TObject.
      end;
    finally
      Stmt.Free;
    end;
  finally
    myStringList.EndUpdate;
    for i := 0 to MyStringList.Count - 1 do
    begin

//   ShowMessage(MyStringList[i]);
    end;
  end;

end;

//--------------------------------------------------------------------------
----

procedure TfrmStringList.FindBtnClick(Sender: TObject);
var
  i: Integer;
begin
  for i := 0 to MyStringList.Count - 1 do
  begin
    if MyStringList.IndexOfname(Edit1.Text) = -1 then
      ShowMessage('Found');
  end;
end;

 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3262 (20080711) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: