Delphi-Quellcode:
procedure TMyInt.SetValue(IntValue: Integer);
begin
if not FInit then
begin
FValue := IntValue;
FMax := FValue;
FMin := FValue;
FInit := True;
end
else
if FValue <> IntValue then
begin
FValue := IntValue;
if FValue > FMax then
FMax := FValue;
if FValue < FMin then
FMin := FValue;
end;
end;
Delphi-Quellcode:
procedure TMyInt.SetValue(IntValue: Integer);
begin
FValue := IntValue;
if not FInit then begin
FMax := FValue;
FMin := FValue;
FInit := True;
end
else if FValue > FMax then FMax := FValue
else if FValue < FMin then FMin := FValue;
end;
I do not understand what he wants her more.
- the codes for TMyInt all work
- only the position of the variable, and that everything is constantly new initializes what the problem
Delphi-Quellcode:
procedure TForm3.Timer1Timer(Sender: TObject);
var
temp: TMyInt; << this is not local, but must be
declared globally in the form
begin
temp.Init; << and it should not be constantly re-initialized