VALID-OBJECT function
- Last Updated: December 13, 2018
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
VALID-OBJECT function
Syntax
VALID-OBJECT is
a built-in LOGICAL function that verifies the validity
of an object reference. If the object has been deleted or equals
the Unknown value (?), the reference is not valid.
This
is the syntax for the VALID-OBJECT function:
|
Element description for this syntax diagram follow:
- object-reference
- An object reference defined as any class or interface type.
If
the object reference points to an object that is currently instantiated, VALID-OBJECT returns TRUE. Otherwise,
it returns FALSE.
VALID-OBJECT can also verify the validity of ABL handle-based objects.
For more information, see ABL Reference.The acme.myObjs.Common.HelperClass sample
methods make use of the VALID-OBJECT function to
verify object references that might not have been initialized, depending on
the order that the methods are invoked. (In fact, the sample order
of execution guarantees valid object references. For more information
on these samples, see Compare constructs in classes and procedures.
However, in a more complex application, the validity of object references
at any given point might well be far from certain.)
For example,
the following HelperClass fragment, the ReportOutput( ) method
verifies that the object reference variable, rCustObj,
has been set to reference a class instance before passing it as
an OUTPUT parameter. In this application, rCustObj must
be set by the ListNames( ) method before ReportOutput( ) can
be run without error:
|