My use is small:
1. Each table is specified in Chinese, the title of this table, the contents of all fields in the table.
2. Windows, data windows, events, classes are also indicated.
My PBL is based on the modular division to be involved, I personally think that it is suitable for my development style. :)
Others are released after each time the memory is used. (Such as: Datastore)
Open the PB, open Word, change your changes, you meet and solve the problem (code and document synchronization!)
In the beginning of each PBScript, you want to write annotations, functions, and functions.
PowerBuilder program development specification
First, the name of the system object
Object name naming rules
Window W_Name
Menu M_Name
User Object UO_NAME
Structure s_name
Function f_name
Data window (DATA Window) normal data window drop-down data window (for DROPDWON DATAWINDOW) D_Name DDDW_NAME
Pipeline p_name
Second, window control naming
Control name naming rules
Command button (CommandButton) CB_NAME
Graphic button (PictureButton) PB_NAME
Checkbox CBX_NAME
Single selection box (radiobox) RB_NAME
Static text (statictext) ST_NAME
Picture P_Name
Group Box (GroupBox) GB_NAME
Line (LINE) LN_NAME
Single editing box (SingleLineEdit) SLE_NAME
Format editing box (editmask) EM_NAME
Multi-line editing box (multilineedit) mle_name
Richtextedit control (richtextedit) RTE_NAME
Horizontal scroll bar (hscrollbar) hsb_name
Vertical scroll bar (vscrollbar) vsb_name
Drop-down list box (DropDownListbox) DDLB_NAME
Drawn Picture list box (DROPDOWNPICTURELISTBOX) DDPLB_NAME
List box (listbox) LB_NAME
Graphic list box (PictureListbox) PLB_NAME
ListView Control (ListView) LV_NAME
TreeView Control (TreeView) TV_NAME
Tab Control (Tab) Tab_name tabpage_name
Data Window Control (DataWindow) DW_NAME
Graph GR_NAME
OLE control OLE_NAME
User Object Up_name
Variable name
Variable type naming rules
Boolean variable (Boolean) XB_Name
Character-like variable (char) XC_NAME
Date variable (DATA) xd_name
Date Time Variables (DataTime) XDT_NAME
Small variable (Decimal) XDEC_NAME
Double precision floating point variable (double) xdou_name
Integer xi_name
Long integer variable (long) XL_NAME
Real variable (Real) XR_NAME
Structural variables XSTR_NAME
String-type variable (String) XS_NAME
Time-type variable (TIME) XT_NAME
No symbolic integer variable (uint) xui_name
No symbolic long-intensive variable (Ulong) XUL_NAME
Description: X of the naming rules for variables
Global variable (global var) x with G
Instance var) x with I
Shared var) x with s
Local var) x uses L replacement
For example: Defining a string variable
Global Var (Global Var) GS_NAME
Instance var) IS_NAME
Shared var) SS_NAME
Local variable (LOCAL VAR) LS_NAME
Define integer variables
Global Var GI_NAME
Instance var) II_NAME
Shared var) Si_Name
Local variable (Local var) li_name
Third, other named
Name naming rule
User Event UE_NAME
Window Function WF_NAME
My thoughts: more packages, write less code!
A person written code may only be read by himself!
l It is recommended to build the Rubbish directory on this unit, which is used to store something that is not used but it is possible.
l Pay attention to the use of existing classes. Use it in inheritance. It is forbidden to see the existing classes, and you will do it again.
L Share's objects should be registered to the version control system, such as Objectcycle, use the Checkin / Checkout mechanism while modifying the object, so that two / more people can jointly maintain the same group of objects without conflicts, the most important thing is to save any Version, easy to submit and recover. When new objects, you should first think of "inherit" instead of "new"!
l PBL naming rules are module identifies their heads such as: JL_.
l Each PBL module should not be greater than 1.5MB, and it should be divided.
I. Introduction
In order to standardize software development code and documentation, it is convenient for maintenance, and the software development specification is set.
Second, documentation requirements
Each system requires: demand analysis document, demand change document, database structure document, database change document, software development document. The document should be programmed first, that is, the corresponding document must be written before writing programs, and then program it according to documentation.
Each window must have a document. The name, function, input, output parameter of the module is required, create, and modify the time.
Third, the program style
The program must have a good indentation format. Take Power Builder as an Example:
IF condition the
Something to do
END IF
That is, each keyword letter is capitalized, and there is 3 air indentation in the corresponding position.
Fourth, variable naming norms (take Power Builder as an example)
1, object naming
Powerbuilder, the object's naming is generally used as the following prefix:
Prefix Object
-------------------------------------------
D_ DataWindows
DDDW_DPDowndataWinows
f_ functions
m_ menus
P_ pipelines
S_ Structures
u_ userobjects
W_ windows
2, the control is named
In the PowerBuilder window, the naming of the control generally uses the following prefix:
Prefix Control
-------------------------------------------------- -------------
CBX_ Checkbox
CB_CommandButton
DW_ DataWindow
DDLB_DOPDOWNLISTBOX
EM_ Editmask
GR_ graph
GB_ GroupBox
HSB_ hscrollbar
LN_ line
LB_ listbox
MLE_ MULTILINEEDIT
OLE_ OLE 2 0
OCX_ OCX
Oval_ Oval
P_ Picture
PB_ PictureButton
RB_ Radiobutton
r_ reccTangle
RR_ RoundRectangle
SLE_ SINGLINEEDIT
ST_ statictext
UO_ User Object
VSB_ vscrollbar
3, variable naming: ------------------------------------------- ------------------
1), the scope is named
Prefix Scope
-------------------------------------------------- -------------
G_global
S_ Shared
i_ instance
l_ local
2), variable type prefix
Prefix DataType
-------------------------------------------------- -------------
B_ boolean
BLOB_BLOB
D_ Double
Date_ Date
Dec_ Decimal
DT_ DateTime
i_ integer
l_ long
S_ string
T_ Time
UI_ undisgned int
UL_ undisgned long
TR_ Transaction Object
Do_ DragObject
DWC_ DataWindowChild
NVO_ NONVISULOBJECT
4, function name
Prefix Scope
-------------------------------------------------- -------------
GF_ Global Function
WF_ WINDOW FUNCTION
MF_ Menu Function
UF_ UserObject Function
V. Program annotation requirements
Each event, function, variable, etc. must be commented. The ratio of the notes and code should be at least 1: 3.
Event, function code start comment mode:
/ ************************************************** ***************************************
Features:
parameter:
return:
Author:
Create: 1999.09.21
Modification: 2000.09.21 *********************************************************************** ********************************************* /
//
//
// function: of_updatechecks
//
// Access: protected
//
// arguments:
// apo_control [] the array of object for which the checks need to be
// performed.
//
// Returns: integer
// 1 = Updates a Found
// 0 = no change
// -1 = accepttext error
// -2 = Updatespending error WAS encountered // -3 = validation error WAS ENCOUNTERED
//
// Description: Perform acceptText, Updatestpending and Validation ON
// The objects.
//
//
The role of the code, logic, etc. in front of each program. Each variable requires its function.
6. Names and memories of objects
There must be objects and developers in each object note.
I think this is quite normal:
First, variable specification
1, prefix
(1), scope
Global: g
Shared: S
Instance: i
Local: L
(2), type
B boolean
BLOB BLOB
D Double
Num number
Date Date
Dec decimal
DT DateTime
I Integer
l Long
String
t time
Ui undisgned int
UL undisgned long
Tr Transaction Object
Do Dragobject
DS Datastore
DWC DataWindowChild
NVO NONVISULOBJECT
Tri TreeViewItem
Lvi ListViewItem
2, format
Action domain type _ English meaning or abbreviation
The initial case of the first letter uppercase or all uppercase (abbreviation)
Note: You cannot define or change global variables.
Second, PowerBuilder object
1, window (Window)
W _ submodule Pinyin code _ function or use (English meaning)
2, data window (DataWindow)
D_ submodule Pinyin code _ function or use (English significance)
3, query (query)
Q_ submodule Pinyin code _ function or use (English meaning)
4, data pipeline (PIPELINE)
P_ submodule Pinyin code _ function or use (English meaning)
5, function (Function)
F_ submodule Pinyin code _ function or use (English significance)
6, global function (GLOBAL FUNCTION)
GF_ function or use (English meaning)
7, window function (Window Function)
WF_ function or use (English meaning)
8, menu function (menu function)
MF_ function or use (English meaning)
9. User Custom Object Function (User Object Function)
UF_ function or use (English meaning)
10, menu (MENU)
M_ submodule Pinyin code _ function or use (English significance)
11, Structure
STRU_ submodule Pinyin code _ function or use (English meaning)
12. User's Custom Objects (User Object)
U_ submodule Pinyin code _ function or use (English meaning)
13, Controls
CBX_ Checkbox
CB_CommandButton
DW_ DataWindow
DDLB_DOPDOWNLISTBOX
EM_ Editmask
GR_ graph
GB_ groupboxhsb_ hscrollbar
LN_ line
LB_ listbox
MLE_ MULTILINEEDIT
OLE_ OLE 2 0
OCX_ OCX
Oval_ Oval
P_ Picture
PB_ PictureButton
RB_ Radiobutton
r_ reccTangle
RR_ RoundRectangle
SLE_ SINGLINEEDIT
ST_ statictext
UO_ User Object
VSB_ vscrollbar
Special Note:
System Fixed Button Name
Cb_yes [is (& y)]
CB_NO [No (& n)]
CB_IGNORE [ignore (& i)]
CB_RETRY [Retry (& R)]
CB_ABORT [Termination (& A)]
CB_OK [OK (& Y)]
CB_CANCEL [Cancel (& C)]
CB_RETURN [Return (& R)]
CB_Close [Close (& X)]
CB_PRINT [Print (& P)]
CB_PRINTPREV [Print Preview (& V)]
CB_GEN [Generate (& g)]
CB_Query [Query (& Q)]
CB_COUNT [Statistics (& T)]
CB_ADD [Add (& A)]
CB_INSERT [Insert (& I)]
CB_DEL [Delete (& D)]
CB_MODIFY [Modify (& M)]]
CB_SAVE [Save (& S)]
CB_SEND [Send (& F)]
CB_AUDIT [Audit (& T)]
CB_ABandon [Waste (& Z)]
CB_First [first] or [9] webdings font
CB_NEXT [later one] or [8] Webdings font
CB_PREV [Previous Art] or [7] WebDings Fonts CB_END [Top] or [:] WebDings Font
Third, PowerBuilder library file
Each submodule contains up to 10 PBL files, which are:
1. Store the Basic Objects (Windows, Menu, etc.) used by the child module:
Submodule Pinyin code serial number (00 - 09) .pbl - 10
2. Store the resource files used by the child module (BMP, ICO, CUR, Ani files)
Submodule Pinyin code res. pbl - 1
Four, code
Reserved word in PowerBuilder
Embedded SQL statement reserved word all uppercase
Custom Function Notes format:
name:
Features:
parameter:
logic:
Be applicable:
Programming:
Create: 2002.01.01
Modification: 2002.02.01
Version: 1.0
The format is as follows: The format is as follows before the important or complex logic code.
// Comment content - programmer's name
......
Code