|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
looping problem
Ok, well first off i'm very new to VB, new to all lang. Anyways the probelm i'm having is looping something. This is what i am trying to do. I'm making a list compactor, prolly never heard of it, mainly cause it doesn't exist yet. What it is, is you load a .txt file into a listbox. And you press a cmd. button with the following code.
Private Sub Command5_Click() Dim lisst2 As Integer lisst2 = 2 List2.AddItem List2.Text If lisst2 = 2 Then Text1.Text = List2.ListCount End If End Sub All that will do, is transfer one string to the other listbox right ?. What i wanna do is loop that, so when i press the button, it will go through ALL the strings, in the 1st listbox, thus transfering everyhting from list1 to list2. If you asking, why such a program. Is because i use proxies, ALOT of proxies. And in a .txt file, you can only paste so many strings, and then it will give u an error saying something bout memory. but with this i found you can do it without that prob. If anyone knows what ima talkin bout, or could even help me, i'd be most appreciated, and credit will be given, where it's do. Thanx for your time. - sniper - |
|
#2
|
||||
|
||||
|
Not sure if I understand all of what your problems are here, but here is a sample little application to demonstrate how to transfere data between two listboxes in different methods.
|
|
#3
|
|||
|
|||
|
I kinda get what ur doin.. but any way.. if u wanna loop something here is how to do it:
first put 'Do' where you want the code to start looping.. then put the code.. then put: loop until somehing = something.. get it? no? heres and example Private Sub Command1_Click() Do Text1 = Text1 + 1 Loop Until Text1 = Text2 End Sub so on this example when u press the cmd.. the text1 (which had a number value) will increase in ones untill it reaches the value of text box 2... then it will just stop! this happens in a split second!.. if you dont get any of this.. just use a timer and put it on 1.. and inside the timer put your code.. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > looping problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|