TypeInfo.Name vs. VarType as UInt32

  1. 4 months ago

    Hans-Norbert G

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

    Hello!

    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

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

    for variant, check type property.

  3. Hans-Norbert G

    is not verified Jul 12 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.

    Regards,
    Hanno

or Sign Up to reply!