Difference between revisions of "MemberInfo.Name"

From Xojo Documentation

(Sample Code)
Line 13: Line 13:
 
This code gets the list of properties for the passed type instance.
 
This code gets the list of properties for the passed type instance.
 
<rbcode>
 
<rbcode>
Var d As New Date
+
Var d As DateTime = DateTime.Now
 
For Each prop As Introspection.PropertyInfo In Introspection.GetType(d).GetProperties
 
For Each prop As Introspection.PropertyInfo In Introspection.GetType(d).GetProperties
 
   ListBox1.AddRow(prop.Name)
 
   ListBox1.AddRow(prop.Name)
 
Next
 
Next
 
</rbcode>
 
</rbcode>

Revision as of 18:53, 14 July 2020

Property (As String )
aMemberInfo.Name = newStringValue
or
StringValue = aMemberInfo.Name

Supported for all project types and targets.

The name of the item. This is only the class name. To get the full namespace path, use FullName instead.

Sample Code

This code gets the list of properties for the passed type instance.

Var d As DateTime = DateTime.Now
For Each prop As Introspection.PropertyInfo In Introspection.GetType(d).GetProperties
ListBox1.AddRow(prop.Name)
Next