On Wed, 24 Feb 2016, Matias De lellis wrote: > Well... > You're right .. The 'Instance' method seems to be hidden.. However, the > example clearly indicates that this was the way to use it..?? > I have to research better, but if they have to be a static class, this does > not help me .. >
You seem to misunderstand Class["name"].Instance. In your first mail you wrote: >> Dim hFirmata As Firmata >> >> hFirmata = Class["Firmata1"].Instance But Firmata1 is the name of one of your *objects*. The syntax Class["name"] searches for a *class* named "Firmata1", which likely does not exist in your component. You only mentioned the class Firmata. As I said earlier, Class["name"].Instance returns the unique automatic instance of an *auto-creatable* class, i.e. one with Create Static. It does not need to be fully static, just Create Static [0]. There is no method to obtain a general object from its name -- because objects do not even need to have something like a "name". It is a different matter, though, if Firmata is a graphical control. Graphical controls always have a name property and you can use a Form's Controls property to search a control by name like this: hMyFirmata = FMain.Controls["Firmata1"] Note again: this only works if you know the form (FMain in this case) where you want to search your object and the object is a control. Regards, Tobi [0] http://gambaswiki.org/wiki/lang/createstatic PS: And yeah, the completion window for "Class[...]" doesn't show here either. -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
