New topic: Introspection on Class properties to match base class
<http://forums.realsoftware.com/viewtopic.php?t=44787> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message JimPitchford Post subject: Introspection on Class properties to match base classPosted: Fri Jul 20, 2012 10:34 am Joined: Mon Apr 11, 2011 2:01 pm Posts: 96 I am trying to use introspection to instantiate selected properties within a class. The properties I wish to instantiate are all subClasses of class "dbField", so I want to search through all the properties of the class and just pick out those with dbField as a base. //get all the properties of r (extended from dbRecord) dim dbProperties() as Introspection.PropertyInfo = Introspection.GetType(r).getproperties //cycle through them for i as integer = 0 to dbProperties.ubound //dbProperties not an array so can't use for each dim p as Introspection.PropertyInfo = dbProperties(i) dim o as Introspection.TypeInfo = dbProperties(i) if o isA dbField then But o isA dbField is never true despite the property being a subclass of dbField. Can someone tell me what is the correct way to test for the property's baseclass using introspection? Jim _________________ Jim OSX 10.6.8, rb2011r4 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
