PowerBuilder程序编码规范

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

PowerBuilder程序编码规范

(转帖------出自程序员基地)

1.1.1 全局变量命名规范

全局变量以g开头,紧接类型+下划线变量功能名称,具体规则如以下

Blob gblb_功能名

Integer or Int gi_功能名

Boolean gb_功能名

Long gi_功能名

Char gc_功能名

character gc_功能名

real gr_功能名

Date gd_功能名

String gs_功能名

DateTime gdt_功能名

Time gt_功能名

Decimal gr_功能名

Dec gr_功能名

UnsignedInteger gui_功能名

UnsignedInt gui_功能名

UInt gui_功能名

Double gr_功能名

UnsignedLong gui_功能名

ULong gui_功能名

对象变量 go_功能名或者g对象简写_功能名

1.1.2 本地变量命名规范

全局变量以l开头,紧接类型+下划线变量功能名称,具体规则如以下

Blob lblb_功能名

Integer or Int li_功能名

Boolean lb_功能名

Long li_功能名

Char lc_功能名

character lc_功能名

real lr_功能名

Date ld_功能名

String ls_功能名

DateTime ldt_功能名

Time lt_功能名

Decimal lr_功能名

Dec lr_功能名

UnsignedInteger lui_功能名

UnsignedInt lui_功能名

UInt lui_功能名

Double lr_功能名

UnsignedLong lui_功能名

ULong lui_功能名

对象变量 lo_功能名或者l对象简写_功能名

1.1.3 实例变量命名规范

全局变量以i开头,紧接类型+下划线变量功能名称,具体规则如以下

Blob iblb_功能名

Integer or Int ii_功能名

Boolean ib_功能名

Long ii_功能名

Char ic_功能名

character ic_功能名

real ir_功能名

Date id_功能名

String is_功能名

DateTime idt_功能名

Time it_功能名

Decimal ir_功能名

Dec ir_功能名

UnsignedInteger iui_功能名

UnsignedInt iui_功能名

UInt iui_功能名

Double ir_功能名

UnsignedLong iui_功能名

ULong iui_功能名

对象变量 io_功能名或者i对象简写_功能名

1.1.4 函数和事件参数命名规范

全局变量以a开头,紧接类型+下划线变量功能名称,具体规则如以下

Blob ablb_功能名

Integer or Int ai_功能名

Boolean ab_功能名

Long ai_功能名

Char ac_功能名

character ac_功能名

real ar_功能名

Date ad_功能名

String as_功能名

DateTime adt_功能名

Time at_功能名

Decimal ar_功能名

Dec ar_功能名

UnsignedInteger aui_功能名

UnsignedInt aui_功能名

UInt aui_功能名

Double ar_功能名

UnsignedLong aui_功能名

ULong aui_功能名

对象变量 ao_功能名或者a对象简写_功能名

1.1.5 窗口、函数、可继承对象命名规范

窗口命名规范:w_模块名_功能名

函数命名规范:f_模块名_功能名

可继承对象命名规范:uo_模块名_功能名

datawindow对象命名规范:d_模块名_功能名

下拉datawindow命名规范:dddw_模块名_功能名

窗体函数命名规范:wf_功能名

可继承对象函数命名规范:uf_功能名

窗口自定义事件命名规范:Ue_功能名

可继承对象自定义事件命名规范:ue_功能名

1.1.6 可视化控件命名规范

一般遵循pb推荐的规则,即控件类型简写_功能名

CommandButton cb_功能名

PictureButton pb_功能名

CheckBox cbx_功能名

RadioButton rb_功能名

StaticText st_功能名

Picture p_功能名

GroupBox gb__功能名

Line ln_功能名

Oval oval_功能名

Ractangle r_功能名

RoundRactangle rr_功能名

SingleLineEdit sle_功能名

EditMask em_功能名

MultiLineEdit mle_功能名

RichTextEdit rte_功能名

HScrollBox hsb_功能名

VScrollBox vsb_功能名

DropDownListBox ddlb_功能名

DropDownPictureListBox ddplb_功能名

ListBox lb_功能名

PictureListBox plb_功能名

ListView lv_功能名

TreeView tv_功能名

Tab tb_功能名

DataWindow dw_功能名

Grap h gr_功能名

OleControl ole_功能名

UserObject uo_功能名

TabPage tabpage_功能名

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有  導航