2017年11月21日 星期二

[ VB2010 ] - 008 條件判斷流程 001

[ VB2010 ] - 008 條件判斷流程 001

●對與錯:

●用電腦運算對與錯:

 

Public Class Form1

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As Boolean, b As Boolean

        a = True
        b = False
        TextBox1.Text = "地球比月球大 is " & a
        TextBox2.Text = "地球比木星大 is " & b
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim moon, earth, jupiter As Integer
        Dim a, b As Boolean
        moon = 1738 : earth = 6378 : jupiter = 71492

        a = earth > moon
        b = earth > jupiter
        TextBox3.Text = "地球比月球大 is " & a
        TextBox4.Text = "地球比木星大 is " & b

    End Sub
End Class

沒有留言:

張貼留言

Messaging API作為替代方案

  LINE超好用功能要沒了!LINE Notify明年3月底終止服務,有什麼替代方案? LINE Notify將於2025年3月31日結束服務,官方建議改用Messaging API作為替代方案。 //CHANNEL_ACCESS_TOKEN = 'Messaging ...