I want to activate a flag when an unexpected warning is raised in my code. I expect a subset of the warnings to be generated by the code and I make use of the commands "warning( 'off', … )" and "warning( 'on', …)" to temporarily disable/enable these expected warning statements. I am using the "lastwarn" command to check if at least one unexpected warning had been triggered.
I've discovered that using the command "warning( 'off', warningID )" will only prevent the corresponding warning from being displayed, but it is still tracked and displayed in "lastwarn". How can I keep track of the unexpected warnings while ignoring the expected warnings (temporarily disabled with the 'off' state around validated function calls)?
Best Answer