help with looping

need help to understand Looping

Page 1 of 1

4 Replies - 550 Views - Last Post: 29 July 2009 - 07:36 AM Rate Topic: -----

#1 Navymike  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-July 09

help with looping

Post icon  Posted 23 July 2009 - 10:50 AM

Need some help to try to understand looping.

Any help would be appricated.

mike
Is This A Good Question/Topic? 0
  • +

Replies To: help with looping

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 465
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: help with looping

Posted 23 July 2009 - 11:08 AM

ok see

for i=0 to listbox1.listcount-1
  strTest= listbox1.list(i) 'edit: rewrite in string strTest evry item in listbox
  if strTest2=listbox1.list(i) then
	 msgbox listbox1.list(i), vbOkOnly ' search for string in strTest2 in listbox list if find then a mesage come with result
  end if
next i



simple example a mesage box will pop up when i gets bigger
Private Sub Command1_Click()
Dim i As Integer
	For i = 1 To 10
		MsgBox i, vbOKOnly
	Next i
End Sub




do while

 
dim i as integer

do

msgbox i, vbOkOnly
i=i+1
while i<11



will return 1,2,3,4,5,6,7,8,9,10

 
dim i as integer

do
i=i+1
msgbox i, vbOkOnly

while i<11



returns 2,3,4,5,6,7,8,9,10,11

 While i < 11
	i = i + 1
	MsgBox i, vbOKOnly
	
 Wend



returns 2,3,4,5,6,7,8,9,10,11

 While i < 11
	
	MsgBox i, vbOKOnly
	i = i + 1
 Wend



returns 1,2,3,4,5,6,7,8,9,10

paste this code in some button click and try how they work you can debug them to see what happening
good luck

This post has been edited by NoBrain: 23 July 2009 - 11:22 AM

Was This Post Helpful? 0
  • +
  • -

#3 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 465
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: help with looping

Posted 23 July 2009 - 11:23 AM

lol i edit it :D
Was This Post Helpful? 0
  • +
  • -

#4 DCunningham  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 41
  • Joined: 19-May 09

Re: help with looping

Posted 29 July 2009 - 07:35 AM

LOL NoBrain! :)
Was This Post Helpful? 0
  • +
  • -

#5 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 465
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: help with looping

Posted 29 July 2009 - 07:36 AM

i was in a phase to do this :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1