2017年11月21日 星期二

[ VB2010 ] - 011 限定條件重複流程 001

[ VB2010 ] - 011 限定條件重複流程 001



●在主控台上列印出15~21
○直到滿足條件前置判斷:
○直到滿足條件後置判斷:
○直到不滿足條件判斷:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = "●在主控台上列印出15~21"
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim I As Integer
        TextBox2.Text = ""
        I = 15
        Do Until I > 21
            TextBox2.Text = TextBox2.Text & CStr(I) & "  "
            I = I + 1
        Loop
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim I As Integer
        I = 15
        TextBox2.Text = ""
        Do
            TextBox2.Text = TextBox2.Text & CStr(I) & "  "
            I = I + 1
        Loop Until I > 21

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim I As Integer
        I = 15
        TextBox2.Text = ""
        While I <= 21
            TextBox2.Text = TextBox2.Text & CStr(I) & "  "
            I = I + 1
        End While
    End Sub
End Class

沒有留言:

張貼留言

113 學年度第 1 學期 RFID應用課程 Arduino程式

113 學年度第 1 學期 RFID應用課程 Arduino程式 https://www.mediafire.com/file/zr0h0p3iosq12jw/MFRC522+(2).7z/file 內含修改過後的 MFRC522 程式庫 (原程式有錯誤) //定義MFRC522...