MS Visual Basic Loops and Cases


  IF ..... Then

        ...

        Else

        ...

   EndIf


   Do while <exp.>


        ...

        ...

   Loop


   Do until <exp.>


        ...

        ...

   Loop


Select Case ...

        case <value>:

        ...

        case <value>:

        ...

        case Else

        ...

End Select


ex.:


select case IntAge

        case 15:

           xty.text = "x"

        case 6 to 11:

           xty.text = "w"

        case 5:

           xty.text = "xyz"

end select


Do

        ...

        ...

Loop while <exp.>


for ... loop


ex.:


for intvar = str to 100 step 1

        ....

        ...

next intvar




NOTE:


to exit a Loop ... or For...

use the following:


Exit Do - Do ... Loop

Exit For - For ... Loop