GxVariant

GxVariant


Version 7.2.10

The GX Variant Control is a dedicated ActiveX control for manipulating gxVariant data type.

The gxVariant data type has the following important features:

  • Uses run-time type information for automatic data conversion according to user demand.
  • Stores id which can be used to identify a data in a complex structure.
  • Stores children. The variants can be connected together to form a tree through child-parent relation.
  • Uses referece counting to save memory and to form a closed tree.
  • Can be a list and can connect list items like children. The list and list items can have children too.
  • The root gxVariant can be accessed by the following properties: Int, Double, String, Date, Variant, Id, Size, Type, NItems, Nchildren.

    To manipulate a child gxVariant, first it must be located by the SetRefPath function and then it can be accessed by the following properties: RefInt, RefDouble, RefString, RefDate, RefVariant, RefId, RefSize, RefType, RefNItems, RefNchildren.

    The RefMoveUp, RefMoveDown, RefMoveNext, RefMovePrevious functions are for traversing the gxVariant tree.

    To build up a tree, first call the AddChild function to add a child to the root gxVariant, then traverse to the child and call the RefAddChild function to add child to child, and so on. The RemoveChild, RefRemoveChild functions are for deleting a child or child of child.

    The CreateList, AddListItem, RefCreateList, RefAddListItem functions can be used to turn a gxVariant into a list. The RemoveListItem, RefRemoveListItem functions are for deleting a list item from the root gxVariant, or from a child gxVariant.

    The SetArray and SetRefArray functions are for importing and converting an array of Variants into an array of integers.

    The gxvar and RefGxvar properties are for passing gxVariant object between GxVariant controls.


    Class Diagram

    GxVariant

    Public:

    Types:

    NameDescription
     GX_VARIANT_TYPES gxVariant types  

    Properties:

    NameDescription
     DateSet/get the root gxVariant as a Date value.  
     DoubleSet/get the root gxVariant as a Double value.  
     gxvarSet/get the root gxVariant as an object.  
     IdThe Id of the gxVariant.  
     IntSet/get the root gxVariant as an Integer value.  
     NChildren[Read only] The number of the children of the root gxVariant.  
     NItems[Read only] The number of items included in the root gxVariant.  
     RefDateSet/get the referenced gxVariant as a byref Date.  
     RefDoubleSet/get the referenced gxVariant as a byref Double.  
     RefGxvar[Read only] Get the referenced gxVariant as an object.  
     RefIdThe Id of the referenced gxVariant.  
     RefIntSet/get the referenced gxVariant as a byref Integer.  
     RefNChildren[Read only] The number of the children of the referenced gxVariant.  
     RefNItems[Read only] The number of items included in the referenced gxVariant.  
     RefSize[Read only] The size of the referenced gxVariant.  
     RefStringSet/get the referenced gxVariant as a byref String.  
     RefType[Read only] The type of the referenced gxVariant.  
     RefVariantSet/get the referenced gxVariant as a byref Variant.  
     Size[Read only] The Size of the root gxVariant.  
     StringSet/get the root gxVariant as a String value.  
     Type[Read only] The Type of the root gxVariant.  
     VariantSet/get the root gxVariant as a Variant value.  

    Methods:

    NameDescription
     AddChildAdd a child to the root gxVariant.  
     AddListItemAdd a list item to the root gxVariant.  
     CreateListRecreate the root gxVariant as list.  
     GetErrorGet the error code and the error message of the last error.  
     GetErrorCodeGet the error code of the last error.  
     GetErrorStringGet the error message of the last error.  
     RefAddChildAdd a child to the referenced gxVariant.  
     RefAddListItemAdd a list item to the referenced gxVariant.  
     RefCreateListRecreate the referenced gxVariant as list.  
     RefMoveDownMove down the reference along a given path.  
     RefMoveNextMove the reference to the next index.  
     RefMovePreviousMove the reference to the previous index.  
     RefMoveUpMove up the reference to the parent of the current referenced gxVariant.  
     RefRemoveChildRemove a child of the referenced gxVariant.  
     RefRemoveListItemRemove a list item from the referenced gxVariant.  
     RemoveChildRemove a child from the root gxVariant.  
     RemoveListItemRemove a list item from the root gxVariant.  
     SetArrayRecreate the root gxVariant as an integer array converted from a Variant array.  
     SetRefArrayRecreate the referenced gxVariant as an integer array converted from a Variant array.  
     SetRefPathReference a gxVariant by path.  
    History