Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Almost there with EWB3
Wed, Mar 11 2020 2:06 PMPermanent Link

Douglas Lyman

Two more errors left for full compile of HealthBiller:

1)  

function TMainForm.OnError(Sender: TObject; const Message: String; Line: Integer): Boolean;
begin
..
end;

Application.OnError := MainForm.OnError;   <<< Error:  Expected a variable...


2) This code still does not compile:

function TMainForm.PageCloseQuery(Sender: TObject): Boolean;
begin
 if (Sender is TPage) and
   (TPage(Sender).ControlCount > 0) and
   (TPage(Sender).Controls[0] is TForm) and
   (TForm(TPage(Sender).Controls[0]).OnCloseQuery <> Nil) then
     Result := TForm(TPage(Sender).Controls[0]).OnCloseQuery  <<< error on this line
 else
   Result := True;
end;
Wed, Mar 11 2020 3:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doug,

<< function TMainForm.OnError(Sender: TObject; const Message: String; Line: Integer): Boolean; >>

The OnError event declaration changed in the last build:

From WebForms unit:

  TErrorEvent = function (Sender: TObject; const Message: String): Boolean of object;

The Line parameter is gone.  The general goal here is to get stack traces in there instead of just the line number.  

Also, EWB 3 just wraps JS Error instances in an EWB Exception object instances so that "is" operations work correctly, whereas previous EWB versions use Error object instances, which had issues with "is" operations in certain browsers.

<< This code still does not compile: >>

You're not passing the correct parameters:

function TMainForm.PageCloseQuery(Sender: TObject): Boolean;
begin
 if (Sender is TPage) and
   (TPage(Sender).ControlCount > 0) and
   (TPage(Sender).Controls[0] is TForm) and
   (TForm(TPage(Sender).Controls[0]).OnCloseQuery <> Nil) then
     Result := TForm(TPage(Sender).Controls[0]).OnCloseQuery (Sender)  // Needs the Sender parameter
 else
   Result := True;
end;

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Mar 12 2020 6:35 PMPermanent Link

Douglas Lyman

Success!

Full compile of HealthBiller with 0 hints and 0 warnings.  Now just waiting for the database video.  Thank you!
Image