XWidgetSoft Forum
https://bbs.xwidget.com/

String to Component name
https://bbs.xwidget.com/viewtopic.php?f=7&t=3014
Page 1 of 1

Author:  BijaN-R [ May 2nd, 2013, 12:12 am ]
Post subject:  String to Component name

Hello friends,
I need to use strings as components name.

I have A series of buttons and series of texts that they are
corresponding together:


button1 ~ text1
button2 ~ text2
.
.
.
button(n) ~ text(n)


I need buttons to do somethings with their correspond texts,
and I want do this in one function for all.

I can extract end number of buttons name with 'substr'. but
how is that possible to use somethings like
"text"+Sender.Name.substr(6) as name of texts?

Author:  qiancang [ May 2nd, 2013, 12:36 am ]
Post subject:  Re: String to Component name

var i = 3;
eval("text"+i).text = "my name is text3";

Author:  BijaN-R [ May 2nd, 2013, 12:50 am ]
Post subject:  Re: String to Component name


Thanks

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/