%|-Rh^H[JK
Ex@#!fz{%
?V7[,I1?
1、"&"替换"+". *riGi
在很多人的编程语言中,用“+”来连接字符串,这样容易导致歧义。良好的习惯是用“&”来连接字符串. Gg-<3z
不正确: 5dL-v&W
dim sMessage as string YY]LK%-
O+'Pq,hn
sMessage="1"+"2" H;$w^Tr
_IgG8)k;
正确: 65<p:
dim sMessage as string *b7v)d#
;9prsvf
sMessage="1" & "2" ;dB=/U>3U
注意:"&"的后面有个空格. ,xR^8G8
*nH ?o* #
2.变量命名大小写,语句错落有秩 C[x!Lf8'
下面大家比较一下以下两段代码: &"L3U
读懂难度很大的代码: s"sX#l[J
dim SNAME as string Gt 2rJ<>
dim NTURN as integer *XNvb ^<
n
P 69W
?rv+ydR/q
if NTURN=0 then !(o)*S
if SNAME="sancy" then >i=O =w
end if @V<