Returns an array of Progress.Reflect.Variable instances describing the class variables that match the specified conditions. There is no guaranteed order for the returned variables. If there are no variables that match the specified conditions, the method returns an indeterminate array.

Return type: Progress.Reflect.Variable class EXTENT

Access: PUBLIC

Applies to: Progress.Lang.Class class

Syntax

GetVariables ( )
GetVariables ( INPUT flags AS Progress.Reflect.Flags )
flags
A Progress.Reflect.Flags instance indicating the access mode(s), scope(s), and/or class level(s) the returned variables must have. See Progress.Reflect.Flags enumeration for more information.
GetVariables() only returns public, non-static variables. GetVariables(flags) returns all ABL class variables based on the flags specified.

Example

The myclass class has the following variable definition:
CLASS myclass:

   DEFINE PUBLIC    VARIABLE  public_int_var     AS INTEGER.
   DEFINE PUBLIC    VARIABLE  public_char_var    AS CHARACTER.
   DEFINE PRIVATE   VARIABLE  private_char_var   AS CHARACTER.
   DEFINE PROTECTED VARIABLE  protected_char_var AS CHARACTER.

END CLASS.
The following example code calls GetVariables() and GetVariables(flags) to return information on the variables in myclass:
USING Progress.Lang.*.
USING Progress.Reflect.*.

DEFINE VARIABLE myPubVars    AS Variable EXTENT NO-UNDO.
DEFINE VARIABLE myNonPubVars AS Variable EXTENT NO-UNDO.
DEFINE VARIABLE myplc        AS Progress.Lang.Class NO-UNDO.
DEFINE VARIABLE mycls        AS Object.
DEFINE VARIABLE loopVar      AS INTEGER.

myplc = Progress.Lang.Class:GetClass("myclass").


myPubVars = myplc:GetVariables().

//below will print: public_int_var Public
//                  public_char_var Public

IF EXTENT(myPubVars) <> ? THEN
DO:
  DO loopVar = 1 TO EXTENT(myPubVars):
    MESSAGE myPubVars[loopVar]:NAME myPubVars[loopVar]:AccessMode.
  END.
END.


myNonPubVars = myplc:GetVariables(Flags:PROTECTED OR Flags:PRIVATE OR Flags:INSTANCE).

//below will print: protected_char_var Protected
//                  private_char_var Private

IF EXTENT(myNonPubVars) <> ? THEN
DO:
  DO loopVar = 1 TO EXTENT(myNonPubVars):
    MESSAGE myNonPubVars[loopVar]:NAME myNonPubVars[loopVar]:AccessMode.
  END.
END.

Notes

  • This method does not return .NET class fields defined as private or internal.