计算机源代码编写规范(VB版本). VB编码规范 VB编码规范.....................................................................................................................................................................1 1 目的 ................................................................................................................................... ........................................1 2 适用范围...................................................................................................................................................................1 3 规范内容...................................................................................................................................................................2 3.1 最低限制的编程规约...............................................................................................................................2 3.2 对象的命名基准.......................................................................................................................................2 3.3 控件的前缀...............................................................................................................................................2 3.4 数据访问对象(DAO,ADO)的前缀......................................................................................................3 3.5 菜单的前缀...............................................................................................................................................4 3.6 其他控件前缀的选择...............................................................................................................................4 3.7 常量和变量的命名基准...........................................................................................................................5 3.8 变量的有效范围.......................................................................................................................................5 3.9 变量有效范围的前缀...............................................................................................................................5 3.10 常量 ...........................................................................................................................................................6 3.11 变量 ...........................................................................................................................................................6 3.12 变量的数据类型.......................................................................................................................................6 3.13 说明变量和过程用途的名字...................................................................................................................7 3.14 用户自定义类型.......................................................................................................................................7 3.15 代码编写规约...........................................................................................................................................7 3.16 代码注释规约...........................................................................................................................................7 3.17 代码的形式...............................................................................................................................................8 3.18 常量的分组化...........................................................................................................................................9 3.19 & 运算符和+ 运算符............................................................................................................................9 3.20 MsgBox、InputBox、以及SQL 查询字符串的作成...........................................................................9 ........................................1 2 适用范围...................................................................................................................................................................1 3 规范内容...................................................................................................................................................................2 3.1 最低限制的编程规约...............................................................................................................................2 3.2 对象的命名基准.......................................................................................................................................2 3.3 控件的前缀...............................................................................................................................................2 3.4 数据访问对象(DAO,ADO)的前缀......................................................................................................3 3.5 菜单的前缀...............................................................................................................................................4 3.6 其他控件前缀的选择...............................................................................................................................4 3.7 常量和变量的命名基准...........................................................................................................................5 3.8 变量的有效范围.......................................................................................................................................5 3.9 变量有效范围的前缀...............................................................................................................................5 3.10 常量 ...........................................................................................................................................................6 3.11 变量 ...........................................................................................................................................................6 3.12 变量的数据类型.......................................................................................................................................6 3.13 说明变量和过程用途的名字...................................................................................................................7 3.14 用户自定义类型.......................................................................................................................................7 3.15 代码编写规约...........................................................................................................................................7 3.16 代码注释规约...........................................................................................................................................7 3.17 代码的形式...............................................................................................................................................8 3.18 常量的分组化...........................................................................................................................................9 3.19 & 运算符和+ 运算符............................................................................................................................9 3.20 MsgBox、InputBox、以及SQL 查询字符串的作成...........................................................................9