Page 1 of 1

Change objects' default names

PostPosted: 19 Feb 2013, 22:16
by Ursego
Make sure all the objects have meaningful names instead of the default ones (like dw_1, 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_line).

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:

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).

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!