[Lazarus] Questions about Lazarus

Peter Williams pewtas at gmail.com
Mon Jul 21 19:43:21 CEST 2008


I'm getting the error: unit1.pas(48,3) Warning: Local variable "List" does not seem to be initialized


Here's the code (which used to work):

unit Unit1; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
  ZConnection, ZDataset, db, DBGrids, DbCtrls, SdfData, StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Datasource1: TDatasource;
    Datasource2: TDatasource;
    DBGrid1: TDBGrid;
    DBNavigator1: TDBNavigator;
    ZConnection1: TZConnection;
    ZTable1: TZTable;
    ZTable2: TZTable;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  Form1: TForm1; 

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
var
  List: TStringList;
begin

  ZConnection1.Connected:=True;

  ZTable1.Active:=True;
  ZTable2.Active:=True;

  list.Add('here');
 {
  while not ZTable2.EOF do
    begin
      List.Add(ZTable2.FieldByName('MAKE').AsString);
      ZTable2.Next;
    end; //while
 }
    //showmessage(list.Strings[0]);
 //  DBGrid1.Columns[0].PickList:=List;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  end;

initialization
  {$I unit1.lrs}
end.

What has happened?

bob k.

                                           
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080721/3a133a73/attachment-0007.html>


More information about the Lazarus mailing list