TypeInfo.Name vs. VarType as UInt32

  1. 7 months ago

    Hans-Norbert G

    is not verified 11 Jul 2018 Pre-Release Testers, Xojo Pro
    Edited 7 months ago


    I have a problem using constructor parameters of introspection.

    When the element types of an array of variants needs to be checked against the ParameterInfo, how would I do this.

    ArgType = Introspection.GetType(Args(i))

    gives me Nil because it's a value type

    Par.ParameterType.Name gives me "string"

    VarType(Args(i))  // gives UInt32

    Do I have to write a mapping myself between TypeString, TypeDouble, etc. and Name of TypeInfo?

    Btw., help says for ConstructorInfo

    Invoke(Optional params() As Auto) As Auto

    But compiler wants params() as Variant

    Any idea really appreciated!

  2. Christian S

    12 Jul 2018 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    for variant, check type property.

  3. Hans-Norbert G

    is not verified 12 Jul 2018 Pre-Release Testers, Xojo Pro

    Hi, Christian,
    thanks a lot for the tip.

    But Type of Variant is also an integer; I have to match the ParameterInfo type somehow to find the correct constructor.
    At the moment I use matching ubounds count for parameters and arguments; but overloading may have same amount of parameters/arguments with different types.

    The only type information from PropertyInfo I can get is IsPrimitive.

    I guess, I have to match it by an own function.


or Sign Up to reply!