Analytics


Google

Thursday, August 21, 2008

Looping from A to Z

There are times we may want to loop by alphabet instead of number, this is how you can do it.

Public Sub loopAtoZ()
Dim ASCIINum, loopCnt As Integer


Try
ASCIINum = AscW("A")

For loopCnt = 0 To 25
Console.WriteLine(ChrW(ASCIINum))
ASCIINum += 1
Next

Catch ex As Exception
Throw New Exception("[loopAtoZ01]" & ex.Message)
End Try
End Sub

No comments: