Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A small bug in 15.2.56
#4
Hi Eddy,

That is because first you clear the lines resulting in Text = ''. After that you assign it the new text.

The same would be

begin
  MyText.Text := '';
  MyText.Text := 'My awesome text';
end;

When you write a 'Setter' for a property it is good practice to do:

procedure TMyClass.SetText(const AValue: string);
begin
  if (FText <> AValue)
  then begin
    FText := AValue;
    DoSomeChangeAction;
  end;
end;

Hope this makes sense.
Reply


Messages In This Thread
A small bug in 15.2.56 - by sonjli - 09-30-2022, 10:21 AM
RE: A small bug in 15.2.56 - by jeroen.rottink - 09-30-2022, 12:34 PM
RE: A small bug in 15.2.56 - by sonjli - 09-30-2022, 12:49 PM
RE: A small bug in 15.2.56 - by jeroen.rottink - 09-30-2022, 04:00 PM
RE: A small bug in 15.2.56 - by Alexandre Machado - 10-06-2022, 06:27 AM
RE: A small bug in 15.2.56 - by sonjli - 10-18-2022, 06:38 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)