Dim i As Integer For i = 0 to 10 'Code here... Msgbox "Current number is " & i Next
Page 1 of 1
Using Loops
By Uentil
#1
Posted 20 August 2008 - 10:26 PM
You can execute multiple things in a sequence by using a Loop.
Page 1 of 1
Other Replies To This Topic
#2
Posted 20 August 2008 - 10:28 PM
You can also loop a few other ways.
You can of course use an inequality sign.
do until x = y 'random code' loop
do while x = y 'random code loop
You can of course use an inequality sign.
#3
Posted 20 August 2008 - 10:36 PM
True that.
I just find the way i posted a bit cleaner and i can understand how its working better.
I just find the way i posted a bit cleaner and i can understand how its working better.
#4
Posted 20 August 2008 - 10:38 PM
Heh, I'm the exact opposite.
I may be wrong but on the last line, shouldn't it read "Next i"?
I may be wrong but on the last line, shouldn't it read "Next i"?
#6
Posted 20 August 2008 - 11:48 PM
Vb loops:
For-next: the overall best in my opinion. Perfect for looping for a predefined amount of times or forever
Do- they are good for when you don't know how many times you'll have to loop, however they are often buggy
For-next: the overall best in my opinion. Perfect for looping for a predefined amount of times or forever
Do- they are good for when you don't know how many times you'll have to loop, however they are often buggy
#7
Posted 21 August 2008 - 03:01 AM
Another way of doing a loop is this:
If x <= 10 Then 'Code Here x = x + 1 Endif
#8
Posted 21 August 2008 - 09:35 AM
Nice, but what about infinite loops? :S
#9
Posted 21 August 2008 - 09:37 AM
If Stop = False Then 'Insert Code Here End If
And just never set Stop to true unless you wanted it to stop lol
#10
Posted 21 August 2008 - 11:17 AM
viper, that'd require a timer and alot of messy coding.
#11
Posted 29 December 2009 - 06:15 PM
Good day to all of you sir. Can someone help me? I'm making a simple list VB6 project. Just for practice. And i have a problem. If I click "save" button, i want to save a data to database but before it save i want to search it first if the data had duplicate and prompts me..
For short i want Search and Save execute at the same button.. PLEASE I'm begging to all of you... PLEASE help me.. I'm a freshmen student...
For short i want Search and Save execute at the same button.. PLEASE I'm begging to all of you... PLEASE help me.. I'm a freshmen student...
#12
Posted 29 December 2009 - 08:16 PM
chesterkill, on Dec 29 2009, 09:15 PM, said:
Good day to all of you sir. Can someone help me? I'm making a simple list VB6 project. Just for practice. And i have a problem. If I click "save" button, i want to save a data to database but before it save i want to search it first if the data had duplicate and prompts me..
For short i want Search and Save execute at the same button.. PLEASE I'm begging to all of you... PLEASE help me.. I'm a freshmen student...
For short i want Search and Save execute at the same button.. PLEASE I'm begging to all of you... PLEASE help me.. I'm a freshmen student...
Well, in order to help you out, I'll need a little bit more of additional information about your project.
First off, what kind of data are you saving? Is it text? Numbers? A combination of both?
And when you click save, do you want the program to first check to see if you have duplicate data entries in the list you are making, before saving the entire list to a database?
And lastly, what format are you saving it to the database? Is it line by line? Or a custom format?
EDIT: To speed things up, we can contact each other via Instant Messenger Services. You can view my information through my profile.
#13
Posted 30 December 2009 - 12:26 PM
while 1=1
{
//execute code
}
...A simple infinite loop?
{
//execute code
}
...A simple infinite loop?
#14
Posted 30 December 2009 - 02:42 PM
He's asking for specific help on checking and storing information in his list and database. And he's working with VB6 as well, not VB8.
Page 1 of 1
| Topic | Started By | Stats | Last Post Info | |
|---|---|---|---|---|
![]() |
Fruity Loops Private
File Updated: 2 Sep 2007 |
CheesySalsa ![]() |
|
|
![]() |
Uentil's SC/BW spoofer for 1.15.1
File Updated: 28 Oct 2007 |
Uentil ![]() |
|
|

Help



Promote to Article
MultiQuote
Reply




