VariableDefinition object
A class describing the characteristics of a variable,
property, or argument. VariableDefinition is used as a property
in the ClassDefinition and ScriptDefinition objects. It has no events.
You cannot start with a variable in your application and get
a VariableDefinition object for it. Instead, you access the VariableDefinition instances
that are elements of the VariableList array of a ClassDefinition instance
or the ArgumentList array of a ScriptDefinition instance.
The VariableDefinition object has information about:
-
The variable’s name
and type -
Whether the variable is a scalar or an array and
information about the array -
The variable’s initial value, whether the
value overrides an ancestor’s value, and whether the variable
is a constant -
The read and write access levels for the variable
-
The scope of the variable (global, shared, instance,
local, argument), including whether the variable is an argument
and how the argument is passed
Properties
VariableDefinition property |
Datatype |
Description |
---|---|---|
CallingConvention |
ArgCalling |
The way an argument is passed when Kind
VarListArgument! applies only to arguments for built-in PowerBuilder |
Cardinality |
Variable |
Cardinality information for the variable. |
ClassDefinition |
PowerObject |
An object of type PowerObject containing |
InitialValue |
Any |
The initial value of the variable. Not |
IsConstant |
Boolean |
Indicates whether the variable is a constant. |
IsControl |
Boolean |
Indicates whether the variable is a control |
IsUserDefined |
Boolean |
Indicates whether the variable is a user-defined Always true for local variables. True for |
Kind |
VariableKind |
The scope of the variable. Values are:
Global variables are found only in the Application object. Argument |
Name |
String |
The name of the variable. |
OverridesAncestor |
Boolean |
Indicates whether the current initial |
ReadAccess |
VarAccess |
The read access to the variable. Values
Not valid when Kind is VariableArgument! or VariableLocal! |
TypeInfo |
TypeDefinition |
Type information for the variable. |
WriteAccess |
VarAccess |
The write access to the variable. Values
Not valid for VariableArgument! or VariableLocal! |
Functions
VariableDefinition |
Datatype returned |
Description |
---|---|---|
String |
Returns the name assigned to the object |
|
Integer |
Creates a reference to a context-specific |
|
PowerObject |
Returns a reference to the name of the |
|
Object |
Returns the type of the object |