[Gambas-user] Re: string to object coercion?  

Benoit Minisini gambas at ...1...
Fri Jul 30 21:24:47 CEST 2004


On Friday 30 July 2004 21:03, Mail List wrote:
> > Am Freitag, 30. Juli 2004 19:25 schrieb Mail List:
> >  > I have a text box name "textbox1"
> >  > I would like to print the text in textbox1
> >  >
> >  > I would like to code the following:
> >  >
> >  > a = "textbox1"
> >
> >  set the text:
> >         textbox1.text = "some text"
> >  get the entry from textbox1:
> >         dim a as string
> >         a = testbox1.text
>
> I probably didn't explain my intentions well enough.
> Instead of
>
> testbox1.text
>
> I would like to substitute a string with the same name as the object  -
> testbox1 - where
>
> dim a as string
> dim b as string
>
> a = "textbox1"
>
> b =  a.text
>
>
> thanks

You can't do that in Gambas, because object names do not exist at execution 
time. You just have a reference stored in a variable whose name is the same 
as the control.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list