What's new

quick VB6 help (1 Viewer)

Ryan Peter

Screenwriter
Joined
Sep 15, 1999
Messages
1,220
I have some different variable names and object names such as myName1, myName2, myName3, etc. They all have the same name, just a different sequential number at the end. Now what I want to do is manipulate those variables in a Do While, or While/Wend loop.



So basically have it loop through and every time it has to go through the loop, the specific variable it attacks is incremented.



for exp.



While x < 21

i = 1

lblDisplay.Visible = True

lblDisplay.Caption = x

x + 1

i + 1

Wend



I could do this in JavaScript pretty well, but I can't seem to figure out how to do it in VB6.



Thanks if you can help!
 

Shayne Lebrun

Screenwriter
Joined
Jun 17, 1999
Messages
1,086
Ooops, let me read your post. If you're iterating through a bunch of button objects, try using either an object array, or don't treat them as variables, use an object loop

FOR EACH button IN form

button.label = 'blah blah'

button.visible = False

next

or some such.

I think there's a wee bit more you need to do to get that work, but that's the general idea.
 

Users who are viewing this thread

Top