Change objects' default names


Link to this posting

Postby Ursego » 19 Feb 2013, 22:16

Make sure all the objects have meaningful names instead of the default generic names like dw_1 and cb_1.

PB helps us with that automatic naming, but sometimes developers forget to rename new objects to something more self-explanatory (like dw_order_header, cb_add_order_item).

If your specific window is inherited from an ancestor having its own objects under universal, but ugly names like dw_1, you physically cannot change these names in the descendant. But there is another simply solution to keep the scripts nice - for example, the next two steps let you get rid of the name dw_1 in your scripts:

Step 1: In the descendant window, declare an instance variable of DataWindow type (or a type, used in your framework as the base DW class) and with a meaningful name (for example, idw_students).

Step 2: In the Open event, make that variable pointing to the DW:

Code: Select all
idw_students = dw_1

From this moment on, only idw_students must be used in the scripts - forget about dw_1!
User avatar
Ursego
Site Admin
 
Posts: 143
Joined: 19 Feb 2013, 20:33



Ketones are a more high-octane fuel for your brain than glucose. Become a biohacker and upgrade yourself to version 2.0!



cron
Traffic Counter

eXTReMe Tracker