Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread FDestroying ???
Fri, Mar 31 2023 10:13 PMPermanent Link

Ian Branch

Avatar

HI Team,
I have this in the Form type..
{code}
...
 private
   { Private declarations }
   FDestroying: Boolean;
...
{code}
and
{code}
...
 protected
   property Destroying: Boolean read FDestroying write FDestroying;
 end;
{code}

and this procedure in the App..
{code}
procedure TLogInForm.DBSLoginRemoteReconnect(Sender: TObject; var Continue, StopAsking: Boolean);
begin
 //
 if FDestroying then
 begin
   Continue := False;
   StopAsking := True;
 end
 else
 begin
   Continue := True;
...
...
{code}
DBSLogin being a TEDBSession.
What I can't establish is where FDestroying is being set one way or the other.  Or, where it should be set one way or the other.  Frown

Thoughts/suggestions appreciated.

Regards & TIA,
Ian
Sat, Apr 1 2023 3:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Maybe I'm misunderstanding but it looks like FDestroying is yours so its your responsibility to set it to True or False.

However, it also looks like you're trying to reference a private variable defined in one form in a second form even if they both inherit from a common form which has FDestroying they are separate instances of the form and I think the private variables will be just that. Think of when you drop a component onto a form you can set the properties individually for each component.

Inheritance is always fun and I'm never certain as to the rules so I generally have a bit of a play.

I'm not sure just what you're trying to accomplish. Should FDestroying should only be set to True when the application is closing, or when specific forms are closing or what?

Roy Lambert
Image