dcsimg
December 3, 2016
Hot Topics:

Basics of VB Programming

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

The For..Next statement is an easy way to control program flow. e.g.

Dim i As Integer
Dim iValue As Integer
For i=0 To 10
 iValue=0+1
Next i

In this situation iValue will equal 0 at the start and will increase by 1 every time until it reaches 10.

This can be used to process items from a list box. e.g.

Dim i As Integer
For i=0 To List1.ListCount
List2.AddItem List1.List(i)
Next i

This code copies all the list items from List1 to List2.





Page 4 of 6



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel