KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to ignore repeated errors from loops when testing
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: August 26, 2010

Ever been developing some code only to encounter an error in a loop that throws up an alert message over and over? The only way out is to break in and skip the loop or abort the test run, costing time and money. In 4D v12 there is now an elegant way out of this situation.

The 4D v12 error window provides a new shortcut that can be used to ignore an error that occurs repeatedly. To do so, hold down the Windows Alt or Mac OS Option key when you click on the Continue button in the 4D error window. The window will no longer be shown if the same error, triggered by the same method at the same line, occurs again. Everything continues as if you continued clicking on the Continue button each time.

The snippet below will throw up the Syntax Error alert, also shown below, because the local variable $i is undeclared. The error will always come from line 34:



The following alert will be shown over and over:



If you hold down Mac Option key or Windows Alt key when clicking on the Continue button this error will be ignored as long as it is in this method and on line 34 (until 4D is restarted). The same error on a different line or in a different method will display the alert.