Uentil 0 Posted August 21, 2008 You can execute multiple things in a sequence by using a Loop. Dim i As Integer For i = 0 to 10 'Code here... Msgbox "Current number is " & i Next Share this post Link to post
Poply 178 Posted August 21, 2008 You can also loop a few other ways. do until x = y 'random code' loop do while x = y 'random code loop You can of course use an inequality sign. Share this post Link to post
Uentil 0 Posted August 21, 2008 True that. I just find the way i posted a bit cleaner and i can understand how its working better. Share this post Link to post
Poply 178 Posted August 21, 2008 Heh, I'm the exact opposite. I may be wrong but on the last line, shouldn't it read "Next i"? Share this post Link to post
rockage 0 Posted August 21, 2008 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 Share this post Link to post
ViperSRT3g 224 Posted August 21, 2008 Another way of doing a loop is this: If x <= 10 Then 'Code Here x = x + 1 Endif Share this post Link to post
Mudkiepz 81 Posted August 21, 2008 Nice, but what about infinite loops? :S Share this post Link to post
ViperSRT3g 224 Posted August 21, 2008 If Stop = False Then 'Insert Code Here End If And just never set Stop to true unless you wanted it to stop lol Share this post Link to post
Uentil 0 Posted August 21, 2008 viper, that'd require a timer and alot of messy coding. Share this post Link to post
chesterkill 0 Posted December 30, 2009 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... Share this post Link to post
ViperSRT3g 224 Posted December 30, 2009 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... 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. Share this post Link to post
lilneo 0 Posted December 30, 2009 while 1=1 { //execute code } ...A simple infinite loop? Share this post Link to post
ViperSRT3g 224 Posted December 30, 2009 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. Share this post Link to post