Try Catch Issue

Helihead

Member
Licensed User
Longtime User
Trying to condense my code I had placed the "Try" for a Try Catch on the same line as the code I was trying to trap. It didn't throw a syntax error on compile or throw an error during run BUT it also did not execute the line of code.

Example:
Try Log("This Line Should Run")
Catch
Log("Only run this if Try fails")
End Try

The result was that it did not execute the Log("This Line Should Run")

If you rearrange to better syntax like:
Try
Log("This Line Should Run")
Catch
Log("Only run this if Try fails")
End Try

It does exactly as you would expect it to and executes the Log("This Line Should Run")

For examples where I had not yet populated the Catch functionality, it didn't execute anything or throw any errors.

Example:
Try Log("This Line Should Run")
Catch
'Add Catch Code
End Try

I understand this is kind of bad syntax but I would expect it to either throw a syntax error and not compile or compile and run. It only took a step through with the debugger to figure out what happened but maybe this should at least be documented.

All in all, awesome product. So far this is about the worst issue I have found. Thanks!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…