【VB】C#との差異 (ループ編)

■ ループ

For文

For 【初期値】 To 【終了値】 Step 【増減値】
   【処理】
Next
http://www.vb-dotnet.com/general5/index.html

For Each文

For Each 【コレクション内の要素を格納する変数】 In 【コレクション】
   【処理】
Next
http://www.vb-dotnet.com/general4/index.html

Do While文(C#のWhile文)

Do While 【条件式】
   【処理】
Loop

■ ループ制御

途中で抜ける(C#のBreak文)

Exit Do
http://www.heishin.co.jp/~mhirama/pc/langcomp/while.html

Continue文

Continue For
Continue Do
Continue While
http://msdn.microsoft.com/ja-jp/library/801hyx6f%28v=vs.80%29.aspx

■ インクリメント・デクリメント

 * For Each文で使いたい時もあるので。

構文

Dim i As Integer
i += 1
i -= 1