Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread EWB 3 Build 7 - Assigned Causes Problem With Forms
Sat, Mar 21 2020 8:23 PMPermanent Link

Rob Frye

Including a call to 'Assigned' referencing a variable within a form class will stop a form from displaying when it is run.  Just being in the source code causes the problem even if the Assigned function is never actually called.

For example -

   create a Visual Client Project
   set the form Background.Color (so that it should be visible when run)
   add a FLabel: TLabel variable to the form class
   add a TestProc procedure to the form class that includes a call to Assigned
   running the project results in a blank page


unit Unit1;

interface

uses WebCore, WebUI, WebForms, WebCtrls, WebLabels;

type

  TForm1 = class(TForm)
  private
     FLabel: TLabel;
  public
     procedure TestProc;
  end;

var
  Form1: TForm1;

implementation

procedure TForm1.TestProc;
begin
  if (Assigned(FLabel)) then
     ShowMessage('YES');
end;

end.
Sun, Mar 22 2020 11:47 PMPermanent Link

Rob Frye

Rob Frye wrote:

Including a call to 'Assigned' referencing a variable within a form class will stop a form from displaying when it is run.  Just being in the source code causes the problem even if the Assigned function is never actually called.

For example -

   create a Visual Client Project
   set the form Background.Color (so that it should be visible when run)
   add a FLabel: TLabel variable to the form class
   add a TestProc procedure to the form class that includes a call to Assigned
   running the project results in a blank page


unit Unit1;

interface

uses WebCore, WebUI, WebForms, WebCtrls, WebLabels;

type

  TForm1 = class(TForm)
  private
     FLabel: TLabel;
  public
     procedure TestProc;
  end;

var
  Form1: TForm1;

implementation

procedure TForm1.TestProc;
begin
  if (Assigned(FLabel)) then
     ShowMessage('YES');
end;

end.
Sun, Mar 22 2020 11:56 PMPermanent Link

Rob Frye

Actually this doesn't seem to be caused by the Assigned function but instead I think is the same problem with the IF statement that I also reported.

This causes the problem -

  if (Assigned(FLabel)) then

While this doesn't -

  if (Assigned(FLabel) = True) then

As well, the problem doesn't occur if the outer brackets aren't used -

   if Assigned(FLabel) then
Image