IVarGetCreateInstance

 (Available in 01 TS COM - TS_COM_DelegateIDispatch)

Purpose

Get a property value as object

Syntax

oObject:=oDelegateIDispatch:IVarGetCreateInstance( #MyObject, #Item )

Arguments

symClass
SYMBOL
symIVar
SYMBOL

Description

Get a property value as object, The method 'IVarGet' could be used to return the same value, except the this method will instanciate a object of the specified class ( 'symClass' ). For the same property the 'IVarGetArgs' method will return an instance of 'TS_DelegateIDispatch'

Returns

OBJECT, Property value

Example

ACCESS CAItem CLASS SomeClass
RETURN SELF:IVarGetCreateInstance( #ItemObject, #Item )

Source

METHOD IVarGetCreateInstance( symClass AS SYMBOL, symIVar AS SYMBOL ) CLASS TS_DelegateIDispatch
LOCAL uRetVal AS USUAL
   TSTrace Enter symIVar
   IF SELF:FInit
      DO CASE
      CASE Empty( symClass )
         uRetVal:=SELF:_IVarGet( NULL_SYMBOL, symIVar, NULL_ARRAY ; ...
        ... , 0U )
      CASE IsClass( symClass )
         uRetVal:=SELF:_IVarGet( symClass, symIVar, NULL_ARRAY ; ...
        ... , 0U )
      OTHERWISE
         TSTrace Warning "!IsClass(symClass)"
         uRetVal:=NIL
      END
   ELSE
      TSTrace Warning "!SELF:FInit"
      uRetVal:=NIL
   END
   TSTrace Leave symIVar
RETURN uRetVal