Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Exception Behavior 4.2.16?
#1
I just noticed this behavior when working on a driver and it seems new. The gist is that exceptions are booting you out of the Try block but not directly into the Catch block, so anything in between gets run. I am pretty sure it didn't used to be this way, I have compiled and attached a sample macro to demonstrate.

I can't remember ever having to exclude stuff from inbetween EndTry and Catch, but it seems like some sort of enforcement is necessary here if this is how it is going to be....

Code:
Method TestExcept()
        Begin
        Locals=
            String  strVal("ABC123");
            String  strTemp;
        EndLocals;

        Try
            // Extract an Invalid Index
            strVal.ExtractSubStr(8,Card4.kMaxValue,strTemp);
            
        EndTry;
            ConOut.FmtStr("Should not ever hit here");
            ConOut.NewLn();
            ConOut.Flush();
        Return;

        Catch
            ConOut.FmtStr("Exception Caught");
            ConOut.NewLn();
            ConOut.Flush();
        EndCatch;
    EndMethod;


Attached Files
.cqcmacropack   Exceptiontest.CQCMacroPack (Size: 575 bytes / Downloads: 0)
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#2
Yes, that is an issue. It's on the list to deal with, but for now you just shouldn't have anything between a try and a catch at all, and when I fix it that will be disallowed, as it is in any exception based language AFAIK.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unhandled system exception in the GUI Thread gReatAutomation 9 2,155 03-23-2020, 01:03 PM
Last Post: Dean Roddey
Photo Unhandled GUI Exception simplextech 3 1,213 01-05-2020, 03:27 PM
Last Post: zra
  Odd LogicSvr behavior gReatAutomation 2 1,109 08-14-2019, 12:40 PM
Last Post: Dean Roddey
  Unhandled system exception in GUI Thread Shaky 75 20,126 06-21-2019, 08:10 PM
Last Post: kblagron
  Odd behavior of Admin interface Mark Stega 1 1,851 10-22-2017, 09:12 AM
Last Post: Dean Roddey
  Field Boolean Image behavior pinballmark 6 2,962 12-28-2015, 04:45 PM
Last Post: pinballmark
  Unhandled Exception Scheduled Events zra 8 4,037 06-25-2015, 05:54 PM
Last Post: zra
  An unknown exception has occured... brathnach 11 4,399 11-10-2013, 06:08 PM
Last Post: brathnach
  FileOutStream Exception wuench 3 1,949 12-29-2012, 08:15 PM
Last Post: Dean Roddey
  unhandled exception Ron Haley 3 1,614 11-13-2012, 08:55 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)