1 2 3 4 5 6 7 | Dim sum As Integer = 0 Do While sum < 100 'condition = true continue sum = sum + 10 Loop |
1 2 3 4 5 6 7 | Dim sum As Integer = 0 Do Until sum >= 100 'condition = true exit sum = sum + 10 Loop |
這種格式會在執行Do迴圈時,判斷Until條件式是否為True,若為True,則立刻終止執行Do-Loop迴圈的敘述區塊,並跳出迴圈;反之,則繼續執行。
沒有留言:
張貼留言