Schultz’s PowerBuilder Notes

Class() and TypeOf()

Class()

The class is the name of an object. You assign the name when you save the object in its painter.

ls_class = Lower(adw.ClassName())

In the above script, the class name will be n_ds or u_dw, or n_ds_add_rows. Here is another sample script:

choose case adw_wrkr_tm.ClassName()

case “dw_mach_op”

ls_type = “Direct Time”

case “dw_handwork_press”

ls_type = “Press Handwork”

case “dw_handwork_finishing”

ls_type = “Finishing Handwork”

case “dw_indirect_labor”

ls_type = “Indirect Time”

end choose

TypeOf()

TypeOf reports an object’s built-in object type. The types are values of the Object enumerated data type, such as Window! or CheckBox!. ClassName reports the class of the object in the ancestor-descendant hierarchy.

choose case TypeOf(adw)

case datastore!

lv_rc = TRUE

case else

lb_rc = FALSE

enc choose

If adw is a descendant of datastore!, like n_ds, it is still of TypeOf datastore!

April 21, 2008 - Posted by rick130 | Powerscript | , , , , , | No Comments Yet

No comments yet.

Leave a comment