I was recently debugging a routine that was within a Try..Catch block. In order to find the error I commented the Try..Catch to let the program crash fully.
I want to leave the Try..Catch commented for a while while I let things run to see if my bug fix works, but I'm afraid that I'll move on the other things, get distracted, and forget to uncomment the Try..Catch before building the next Release version of this app.
I though that doing the following might serve as a good reminder and prevent me from compiling in Release mode while still letting me run in Debug to test other things:
And it works in that I can run in Debug to test the app, but am prevented from building in Release mode.
But, even in Debug the IDE complains that something is wrong:
Is there any way I can prevent the IDE from marking the unused text/code as being in error when I have Debug mode selected?
Or, does anyone have a better way of marking code to prevent running in Release mode while allowing running in Debug?
Thanks in advance.
Update: adding 'ignore doesn't help
Update: The "'catch' is missing" warning is just because of the word 'Try' in the text 'Put the Try above back', so that can be ignored here.
I want to leave the Try..Catch commented for a while while I let things run to see if my bug fix works, but I'm afraid that I'll move on the other things, get distracted, and forget to uncomment the Try..Catch before building the next Release version of this app.
I though that doing the following might serve as a good reminder and prevent me from compiling in Release mode while still letting me run in Debug to test other things:
B4X:
'Try 'commented for testing only - NEEDS PUTTING BACK BEFORE NEXT RELEASE!!!!!!
#If RELEASE
Put the Try above back!
#End If
'...code that is now hopefully fixed goes here.....
' Catch
' Log(LastException)
#If RELEASE
Put these back too
#End If
' End Try
But, even in Debug the IDE complains that something is wrong:
Is there any way I can prevent the IDE from marking the unused text/code as being in error when I have Debug mode selected?
Or, does anyone have a better way of marking code to prevent running in Release mode while allowing running in Debug?
Thanks in advance.
Update: adding 'ignore doesn't help
Update: The "'catch' is missing" warning is just because of the word 'Try' in the text 'Put the Try above back', so that can be ignored here.
Last edited: