70 likes | 389 Views
Dim C As Single Dim S As Single Let C = 2 * Pi * r Let S = Pi * r * r. 赋值号. 圆周长变量. 表达式. Let C = 2 * Pi * r. 有一个变量 i ,初始值为 0 ,每次给它加 1 ,共加 5 次,用赋值语句如何表示?. i = i + 1. [Let] 变量 = 表达式. 读作:将表达式的值赋给变量. Private Sub Form_Click() Dim x As Single, y As Single Form1.Print -61; -34
E N D
Dim C As Single Dim S As Single Let C = 2 * Pi * r Let S = Pi * r * r
赋值号 圆周长变量 表达式 Let C = 2 * Pi * r
有一个变量i,初始值为0,每次给它加1,共加5次,用赋值语句如何表示?有一个变量i,初始值为0,每次给它加1,共加5次,用赋值语句如何表示? i = i + 1
[Let] 变量 = 表达式 读作:将表达式的值赋给变量
Private Sub Form_Click() Dim x As Single, y As Single Form1.Print -61; -34 Form1.Print 9 * 2; 12 Form1.Print "This is"; "a book" x = 3: y = 4 Print "x="; x, "y="; y End Sub
输出语句格式: [对象].Print [表达式列表][{;|,}]
Private Sub Form_Click() Dim a As Integer, b As Integer, c As Integer Dim str As String Let a = 54 Let b = 114 c = a + b str = "Hello World" Print "a="; a, "b="; b, "c="; c Print str End Sub