5 Replies - 2684 Views - Last Post: 05 October 2010 - 04:56 PM Rate Topic: -----

#1 vennesschan  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 112
  • Joined: 20-April 10

How to use DO WHILE

Posted 04 October 2010 - 07:28 AM

Hi,

I am confusing about using the Do While.

How to use Do While to scan the listbox, if the listbox item match the string and do something else?

Thank you.
Is This A Good Question/Topic? 0
  • +

Replies To: How to use DO WHILE

#2 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2533
  • View blog
  • Posts: 4,633
  • Joined: 24-September 10

Re: How to use DO WHILE

Posted 04 October 2010 - 07:38 AM

Do While and Do Until are just loops that 'do' something 'while some boolean evaluates true'.

Here's an msdn article on its use.

http://msdn.microsof...w(v=VS.90).aspx
Was This Post Helpful? 0
  • +
  • -

#3 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1049
  • View blog
  • Posts: 4,076
  • Joined: 02-July 08

Re: How to use DO WHILE

Posted 04 October 2010 - 07:55 AM

I would use a For Loop for that:

For Each s As String In listbox1.Items
  If s = <someValue> then
    'do this
  Else 
    'do that
  End If
Next

Was This Post Helpful? 0
  • +
  • -

#4 fixo  Icon User is offline

  • D.I.C Regular

Reputation: 85
  • View blog
  • Posts: 335
  • Joined: 10-May 09

Re: How to use DO WHILE

Posted 04 October 2010 - 09:49 AM

View Posthawkvalley1, on 04 October 2010 - 06:55 AM, said:

I would use a For Loop for that:

For Each s As String In listbox1.Items
  If s = <someValue> then
    'do this
  Else 
    'do that
  End If
Next

Agreed, but
Me too using the same method on my end
but sometime is good reason to exit from
iteration after the value was found in there
(say looping through block attributes in AutoCAD)
For Each s As String In listbox1.Items
            If s = <someValue> then 
                'do this  
                Exit For
            Else
                'do that
                 Exit For
            End If
        Next


Hope you don't mind :)

~'J'~

This post has been edited by fixo: 04 October 2010 - 09:50 AM

Was This Post Helpful? 0
  • +
  • -

#5 vennesschan  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 112
  • Joined: 20-April 10

Re: How to use DO WHILE

Posted 05 October 2010 - 03:13 PM

Hi guys,

Thank you for your helps

How can i have loop for each item every 1 mins?

Thanks
Was This Post Helpful? 0
  • +
  • -

#6 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1049
  • View blog
  • Posts: 4,076
  • Joined: 02-July 08

Re: How to use DO WHILE

Posted 05 October 2010 - 04:56 PM

Use a timer with the interval set to 60000.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1