欢迎光临
我们一直在努力

ASP中,常用的变量命名规则

建站超值云服务器,限时71元/月

在asp编程中,如果你遵守了下面的变量命名规则,你的代码的可行性、可维护性将会更好:

一般命名规则

前缀 变量类型 例子

b or bln boolean bsuccess

c or cur currency camount

d or dbl double dblquantity

dt or dat date and time dtdate

f or flt float fratio

l or lng long lmilliseconds

i or int integer icounter

s or str string sname

a or arr array ausers()

o or obj com object opipeline

数据库对象的变量前缀:

前缀 对象类型 例子

cnn connection cnnpubs

rst recordset rstauthors

cmd command cmdemployee

fld field fldlastname

作用范围相关前缀:

前缀 描述

g_ 在global.asa中创建的变量

m_ 在include文件和asp文件中创建的变量

没有前缀 非静态变量,或者过程中的变量

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ASP中,常用的变量命名规则
分享到: 更多 (0)