Author: time2innov8 | Posted on: 8/10/2009 12:30:40 PM | Views : 316

 What I am trying to achieve is the following:
I have a sequence of labels called name1, name2, name3 etc
How can I change the labels using variable substitution, if I have a counter that increments is there a way to use a loop to reference each label?
i.e.
dim templabel as label
dim tempstring as string=""
dim counter as integer=0
while counter < 4
counter=counter+1
templabel.ID="name" & counter.string
templabel.text="my label text"
end while


At the moment I am having to refer to them by their programmed name with the following code:


name1.text="my label text 1"
name2.text="my label text 2"
name3.text="my label text 3"


Using that code is not too bad for a small number of labels but I will be looking to increase the number considerably.
...

Go to the complete details ...