![]() |
Re: Calculate Min Max of integer
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:
I do not understand what he wants her more.
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; - 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 |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:20 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz