Ghoztcraft [Gaming Made Easy]: Using Loops - Ghoztcraft [Gaming Made Easy]

Jump to content

Digg Del.ico.us Slashdot Technorati furl Reddit Facebook Fark Google Magnolia Wink Yahoo Netscape
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Options
Using Loops By Uentil

#1 User is offline   Uentil 

  • Uentil hax
  • Group: True Members
  • Posts: 364
  • Joined: 29-December 05
  • Server: USWest
  • BNSN: Uentil

Posted 20 August 2008 - 10:26 PM

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



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Other Replies To This Topic

#2 User is offline   Poply 

  • Ghoztcraft Contributor
  • Group:  Retired Staff
  • Posts: 2,839
  • Joined: 21-December 05
  • Server: USWest
  • BNSN: poplyx

Posted 20 August 2008 - 10:28 PM

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.

#3 User is offline   Uentil 

  • Uentil hax
  • Group: True Members
  • Posts: 364
  • Joined: 29-December 05
  • Server: USWest
  • BNSN: Uentil

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.

#4 User is offline   Poply 

  • Ghoztcraft Contributor
  • Group:  Retired Staff
  • Posts: 2,839
  • Joined: 21-December 05
  • Server: USWest
  • BNSN: poplyx

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"?

#5 User is offline   Uentil 

  • Uentil hax
  • Group: True Members
  • Posts: 364
  • Joined: 29-December 05
  • Server: USWest
  • BNSN: Uentil

Posted 20 August 2008 - 10:41 PM

yeah, next i

#6 User is offline   rockage 

  • Member
  • Group: New Members
  • Posts: 16
  • Joined: 20-August 08
  • Server: USWest
  • BNSN: 3volutionize

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

#7 User is offline   ViperSRT3g 

  • Admin In Training
  • Group:  Retired Staff
  • Posts: 4,953
  • Joined: 06-January 06
  • Server: USWest
  • BNSN:

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 User is offline   Mudkiepz 

  • Black Mudkipz Clan Leader
  • Group:  Retired Staff
  • Posts: 454
  • Joined: 30-May 08
  • Server: Northrend
  • BNSN: FrosZ

Posted 21 August 2008 - 09:35 AM

Nice, but what about infinite loops? :S

#9 User is offline   ViperSRT3g 

  • Admin In Training
  • Group:  Retired Staff
  • Posts: 4,953
  • Joined: 06-January 06
  • Server: USWest
  • BNSN:

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 User is offline   Uentil 

  • Uentil hax
  • Group: True Members
  • Posts: 364
  • Joined: 29-December 05
  • Server: USWest
  • BNSN: Uentil

Posted 21 August 2008 - 11:17 AM

viper, that'd require a timer and alot of messy coding.

#11 User is offline   chesterkill 

  • Newbie
  • Group: True Members
  • Posts: 1
  • Joined: 29-December 09
  • Server: USWest
  • BNSN:

Post icon  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...

#12 User is offline   ViperSRT3g 

  • Admin In Training
  • Group:  Retired Staff
  • Posts: 4,953
  • Joined: 06-January 06
  • Server: USWest
  • BNSN:

Posted 29 December 2009 - 08:16 PM

View Postchesterkill, 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...


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 User is offline   lilneo 

  • $p4m m4$t3r
  • Group: True Members
  • Posts: 9
  • Joined: 12-May 07
  • Server: USWest
  • BNSN: lilneo

Posted 30 December 2009 - 12:26 PM

while 1=1
{
//execute code
}
...A simple infinite loop?

#14 User is offline   ViperSRT3g 

  • Admin In Training
  • Group:  Retired Staff
  • Posts: 4,953
  • Joined: 06-January 06
  • Server: USWest
  • BNSN:

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
  • You cannot start a new topic
  • You cannot reply to this topic


Similar Topics
  Topic Started By Stats Last Post Info
New Replies Icon Fruity Loops Private
File Updated: 2 Sep 2007
CheesySalsa 
  • 0 Replies
  • 154 Views
New Replies Icon Uentil's SC/BW spoofer for 1.15.1
File Updated: 28 Oct 2007
Uentil 
  • 0 Replies
  • 1,333 Views

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users