Do
〔Statements〕
〔Exit Do〕
〔Statements〕
Loop〔{While | Until} Condition〕
' Reverseは文字列を反転した値を返す。
' resultには"EDCBA"が格納される。
result = Reverse ( "ABCDE" )
MessageBox ( result )
Function Reverse ( chrValue )
Dim chrString ,chrLength
cnt = 0
chrLength = Len ( chrValue )
Do
chrString = chrString + Mid ( chrValue ,chrLength - cnt , 1 )
cnt = cnt + 1
Loop While ( cnt < chrLength )
Reverse = chrString
End Function