Retrieving the definition
GetDefinition is used to retrieve the definition of content type (and not the definition of variable type).
Example:
If two classes "DerivedClasse" and "BaseClass" derive from each other. If the instances of "DerivedClass" and "BaseClass" are handled by a "dynamic BaseClass" variable, GetDefinition returns the definition of real class of instance.
po is dynamic BaseClass
d is Definition
po = new BaseClass
d = GetDefinition(po)
Trace(d.Name)
po = new DerivedClass
d = GetDefinition(po)
Trace(d.Name)
If the type of the element is not supported, GetDefinition returns a Null definition with a non-fatal error ("Invalid definition").
If the element is not allocated, GetDefinition returns a Null definition with a non-fatal error ("Element not allocated").
The error cases can be processed:
- by comparing the description to Null.
- by checking the value of the ErrorOccurred variable.
The following types of elements are supported:
- native variables and members
- advanced variables and members
- variables and members of type class
- variables and members of type structure
The following types of elements are not supported:
- variables and members of .NET type
- windows, reports, pages, controls, etc.
- HFSQL files, queries, items, etc.