Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Problem With Exception in 2.02
Wed, Oct 14 2015 3:22 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

I have just upgraded to EWB 2.02 and my code now throws an error in the
Exception handling routine where it cannot see the variable 'status'
that is declared at the begining of the procedure.

Is this a breaking change or a bug?

procedure TForm1.SetMessage(msg: string);
   var status: Boolean;
begin
   status := false;

   try
      MessageEdit.Text := msg;
      status := true;
   except
      on E: Exception do
         begin
            LogOutput('Cannot set message : ' + msg);
            status := false;   <-- This throws an error
         end;
   end;

   Result := status;
end;

--
Chris Holland
[Team Elevate]
Wed, Oct 14 2015 3:25 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Sorry, just seen Matthew's post about the same thing.

Ignore this one and I will follow his post for a reply.

Chris Holland
[Team Elevate]

On 14/10/2015 08:22, Chris Holland wrote:
> I have just upgraded to EWB 2.02 and my code now throws an error in the
> Exception handling routine where it cannot see the variable 'status'
> that is declared at the begining of the procedure.
>
> Is this a breaking change or a bug?
>
> procedure TForm1.SetMessage(msg: string);
>     var status: Boolean;
> begin
>     status := false;
>
>     try
>        MessageEdit.Text := msg;
>        status := true;
>     except
>        on E: Exception do
>           begin
>              LogOutput('Cannot set message : ' + msg);
>              status := false;    <-- This throws an error
>           end;
>     end;
>
>     Result := status;
> end;
>
Image