Dim x //申明變量x x = "我是x變量" TracePrint x //在控制臺打印出x變量 Dim a a = 10 TracePrint a+5 //在控制臺打印出a變量 Dim arr(5) //數(shù)組申明 arr(0) = "我是0號" arr(1) = "我是1號" arr(2) = 2 num = 0 For 5 //For 循環(huán)的用法 TracePrint arr(num) num = num + 1 Next aa = 9 //申明變量時候 Dim可以省略 If aa = 5 Then //If條件語句的用法 TracePrint "aa等于5" ElseIf aa = 6 Then TracePrint "aa等于6" ElseIf aa = 7 Then TracePrint "aa等于7" Else TracePrint "aa不等于5,6,7" End If KeyPress "w", 1 //按下鍵盤w鍵1次 KeyPress "r", 2 //按下鍵盤r鍵2次 TracePrint Cstr(aa)//把數(shù)字轉(zhuǎn)換成字符串 bb = 0 While bb < 5 //while循環(huán)的用法 TracePrint bb bb = bb+1 Wend c1 = "我是" c2 = "中國人" TracePrint c1 & c2//字符串鏈接 Function test(a,b) //函數(shù)定義 TracePrint "結(jié)果 "&(a+b) End Function Call test(5,6) //函數(shù)調(diào)用 原文鏈接:https://blog.csdn.net/u011266694/article/details/78312067
|
|