unit Abgespeckt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes,
Graphics, Controls, Forms,
DB, ADODB, Dialogs;
AClass =
class(TObject)
protected
FRelationList: TStringList;
HasReadRelationListFromDB: Boolean;
function GetiNumMembers: smallint;
public
constructor Create(X:
array of const);
property RelationList: TStringList
read GetRelationList;
property NumberOfMembers: smallint
read GetiNumMembers;
end;
implementation
constructor AClass.Create(X:
array of const);
// *************************************************
var
key:
string;
begin
inherited Create;
HasReadRelationListFromDB := false;
FRelationList :=
nil;
end;
function AClass.GetiNumMembers: smallint;
// ............................................
begin
MessageDlg(inttostr(RelationList.Count), mtInformation, [mbOK], 0);
end;
function AClass.GetRelationList: TStringList;
begin
if not HasReadRelationListFromDB
then //<< Hier wird HasReadRelationListFromDB als true im Debugger angezeigt.
begin
HasReadRelationListFromDB := true;
// << Diese Zeile wird nie erreicht
FRelationList := TStringList.Create;
// read someting from a db.
end;
Result := FRelationList;
end;
end.