Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Getting detailed information about the class – PB Docs 2018 – PowerBuilder Library

Getting detailed information about the class – PB Docs 2018

Getting detailed information about the class

This section has code fragments illustrating how to get
information from a ClassDefinition object called cd_windef.

For examples of assigning a value to cd_windef, see Getting a class definition
object
.

Library

The LibraryName property reports the name of the library a class
has been loaded from:

Ancestor

The Ancestor property reports the name of the class from which
this class is inherited. All objects are inherited from PowerBuilder
system objects, so the Ancestor property can hold a ClassDefinition
object for a PowerBuilder class. The Ancestor property contains a null
object reference when the ClassDefinition is for PowerObject, which is
the top of the inheritance hierarchy.

This example gets a ClassDefinition object for the ancestor of the
class represented by cd_windef:

This example gets the ancestor name. Note that this code would
cause an error if cd_windef held the definition of PowerObject, because
the Ancestor property would be NULL:

Use the IsValid function to test that the object is not
NULL.

This example walks back up the inheritance hierarchy for the
window w_genapp_frame and displays a list of its ancestors in a
MultiLineEdit:

The list might look like this:

Parent

The ParentClass property of the ClassDefinition object reports the
parent (its container) specified in the object’s definition:

If the class has no parent, ParentClass is a null object
reference. This example tests that ParentClass is a valid object before
checking its Name property:

Nested or child classes

The ClassDefinition object’s NestedClassList array holds the
classes the object contains.

NestedClassList array includes ancestors and
descendants

The NestedClassList array can include classes of ancestor
objects. For example, a CommandButton defined on an ancestor window
and modified in a descendant window appears twice in the array for the
descendant window, once for the window and once for its
ancestor.

This script produces a list of the controls and structures defined
for the window represented in cd_windef.

This script searches the NestedClassList array in the
ClassDefinition object cd_windef to find a nested DropDownListBox
control:

Class definitions for object instances as distinct from object
references

Getting a ClassDefinition object for an instantiated object,
such as an ancestor or nested object, does not give you a reference to
instances of the parent or child classes. Use standard PowerBuilder
programming techniques to get and store references to your
instantiated objects.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x