XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently March 28th, 2024, 5:46 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: String to Component name
PostPosted: May 2nd, 2013, 12:12 am 
Offline
User avatar

Joined: April 12th, 2013, 3:56 pm
Posts: 10
Location: Iran
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?


Top
 Profile  
 
PostPosted: May 2nd, 2013, 12:36 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
var i = 3;
eval("text"+i).text = "my name is text3";


Top
 Profile  
 
PostPosted: May 2nd, 2013, 12:50 am 
Offline
User avatar

Joined: April 12th, 2013, 3:56 pm
Posts: 10
Location: Iran

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 69 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group