[Gambas-user] Object names

Christopher Brian Jack brian at ...1334...
Fri Nov 10 23:18:25 CET 2006


On Fri, 10 Nov 2006, Rob wrote:

> It can't be done currently, and as far as I can tell it's by
> design.  I wish there were a .name property on every object,
> because there is a lot of legacy VB code that's a pain to
> convert without it.
>
> You have to do something like this:
>
> > PUBLIC SUB SomeSub(client as Control)
>
> If client = SomeTextBoxOnMyForm
> 	...
> End If
>
> > END
>
> Unfortunately, this isn't useful for debugging, and the solution
> is to use tags or other kludges.  Seeing as how we can name
> event handlers using strings at run time using Object.Attach,
> meaning symbol names are never completely stripped out, I can't
> understand the opposition to getting control names at run time
> too.

What about adding a project option: [x] Create Symbol Lookup Class

Implemented as a static class that automagically generates the big long
list of If's needed to be able to look up names for an object handle and
make sure the IDE always regenerates it prior to compiling or recompiling.

The only problem is this would also require [x] Make form controls public,
and that is not a good thing.

.=================================================.
|  Christopher BRIAN Jack aka "Gau of the Veldt"  |
+================================================='
| oevna at ...1544...
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...
Hi Humans, my email address uses rot13 cipher





More information about the User mailing list