From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)

Used to get information about the parameters of a method via the Introspection system.

IsByref fa-lock-32.png ParameterType fa-lock-32.png


You obtain an array of ParameterInfo by calling the MethodInfo.GetParameters method. Get the number of parameters for a method by getting the Ubound of the resulting array and cycle through the parameters by examining the ith element. Examine the ParameterType of each element to get its datatype.

Sample Code

This code displays signatures for all methods of a class:

Var cls As Introspection.TypeInfo = GetTypeInfo(Dictionary)
For Each method As Introspection.MethodInfo In cls.GetMethods
// Collect parameter types
Var paramTypes() As String
For Each paramInfo As Introspection.ParameterInfo In method.GetParameters

// Build the method signature
If method.ReturnType <> Nil Then
Listbox1.AddRow("Function " + method.Name + "(" + Join(paramTypes, ", ") + ") As " + method.ReturnType.Name)
Listbox1.AddRow("Sub " + method.Name + "(" + Join(paramTypes, ", ") + ")")
End If

See Also

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