Clean code principle: run targeted code only once, even if multiple executions won’t ‘hurt anything’. Make sure of this in 4D by encapsulating code with a Case of targeting specific events and turn off unneeded events. This provides clarity on what code is to execute for the specified event. It also prevents code from executing [...]
Posts Tagged ‘form event’
Encapsulate form/object methods with form event case statements
Posted in 4D, tagged 4D, 4D v11, case of, clean code, form event, macro on May 3, 2011 | 1 Comment »
Toggle off 4D form events for easier debugging
Posted in 4D, tagged 4D, 4Dv11, clean code, debugger, event, form event on May 2, 2011 | 2 Comments »
Default Setup When creating a new form in 4D v11 it comes with a range of events ‘enabled’ (see figure). I’m assuming this is for ease of development. However, I advocate for turning off all events first and then enabling specific events on an as needed basis. 4D will go into each form method and [...]