文档介绍:VBS 语言使用方法(The VBS language usage method)
The use of VBS language
The brand name is: Overview: VBScript Microsoft Visue can be removed, the effect will not be changed
The brand:
The brand name format is: const = constant constant value.
For example: const PI=3. 1415926 AP
The brand "NAME= const memory”
AP two, advanced
Improving
the data type conversion:
AP 1)
The brand
Dim a, B, C
The brand
a=inputbox ("A:”,
z,input radius")
The brand
b=Inputbox ("B:”,
z,input radius")
Which was
c=a*2+b*2
Which was
Which was
1 and 2 when this
input is 6
AP 2)
The brand
Dim a, B, C
The brand
a=inputbox ("A:”,
z,input radius")
The brand
b=Inputbox ("B:”,
z,input radius")
Which was c=
(a+b) *2
Which was Msgbox (c)
Which was 1 and 2 when this input is 24
为什么会不一样呢?在数学上c=(a+b)*2和c=a*2+b*2是等 价的,〃+〃上,在VBS中,+不仅仅是加 号的意思还表示把两个字符串连接起来,例如 "Hello"+"World"="HelloWorld" have you understood?你还记得 InoutBox函数的返回值吗?是字符串!这就看出问题了吧,在编程 中〃 1〃不等于(0)1, 〃1〃是一个字符,而1是一个数,所以a, b都是 字符串变量,〃1〃+〃2〃二〃12〃,这就好像我们小时跟伙伴开玩笑问他 们1+1二?一样,我们总是笑着说〃错啦,应该是11〃.但为什么,a可以 *2却不发生错误呢?这时VBS比较智能的一个表现,如果这个字符 串的内容是一个数且对他进行数学运算,则把字符串强制转换A number of participating in operation, if the string representation of a number, but not in math, but in string operations (merger) as string processing, so you see the a+b=12, then the results of