ConstructorInfo

From Xojo Documentation

Revision as of 18:55, 19 November 2009 by Npalardy (talk | contribs) (1 revision)


Description

Contains information about the constructors for a class via the Introspection system.


Super Class

MemberInfo

Properties

Name Type Description
ReturnType TypeInfo If the constructor returns a value, this is the datatype of the returned value. If the method does not return a value, ReturnType is Nil.


Methods

Name Parameters Return Type Description
GetParameters ParameterInfo() Returns an array of ParameterInfo items. Use GetParameters to obtain datatype information on the constructor's parameters.
Changed 2008r2
Invoke
[params() as Variant] Datatype of the object being instantiated. Invokes the constructor. Pass the optional array of variants for the constructor's parameter values, if any. You will get an OutOfBoundsException if the number of parameters does not match or an IllegalCastException if the types do not match.


Examples

This example gets the ConstructorInfo for the FolderItem class. The Invoke method is used to create a new instance based on the constructor that takes no parameters.

Dim ci() as Introspection.ConstructorInfo=ti.GetConstructors

f=ci(0).Invoke

See Also

Introspection module; AttributeInfo, MemberInfo, MethodInfo, ObjectIterator, ParameterInfo, PropertyInfo, TypeInfo classes; GetTypeInfo function.