PowerBuilder variables and naming specifications and precautions

zhaozj2021-02-11  229

PowerBuilder programming variable naming and precautions Author: Flow square Home: http: //liulee.myrice.com

Any control can be seen as a variable, mainly including objects, variables, and corresponding scope, each entity, should be seen from the name in that scope, what kind of basic information is made.

1, object naming

Powerbuilder, the object's naming is generally used as the following prefix:

Prefix Object

-------------------------------------------------- -------------

DW_ 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

PowerBuilder Programming Notes Author: Flow square Home: http: //liulee.myrice.com a program to write good habits of programmers, basically have the following characteristics:

1, clear structure, clear logic;

2, variables, code, annotation specifications

3, the project related documents are clear, clear, reasonable classification;

4, the most important point is that you can understand yourself a year.

From the above requirements, I finish the following:

1, library file classification and naming:

The library file (PBL, PowerBuilder Library) stores all objects, so first of all these objects are normative, clear.

Objects typically stored in PBL are named:

Prefix _ child model encoding _ object description string

Such as a data window:

D_SYS_STATUSBAR_FREE

It is shown to be a diversified window for system management, which is used to place the status bar, which is the free type.

GF_CM_CENTER_WINDOW

Indicates that it is a global function, cm = Common indicates a common function, and the role is used to Center Window.

Another example gf_cm_center_window_in_mdi

Then, it is more clear that the function is used in an MDI Frame to place a window.

From this we can get a naming method of the PBL file:

Sub-model encoding - model name

If SYS_FRAME.PBL indicates that all objects for the program framework are stored for system management. The secondary prefixes of any object are represented by SYS_

D_SYS_STATUSBAR_FREE

Another example is that cm_utility.pbl indicates that all kinds of tools that may be called by the public tool library. Such as cm_center_window, etc.

Of course, simple applications can be placed directly in a library file without having to reassure.

Another classification method is similar to the classification method in PB Example, that is, the same object type is stored in the same library file, such as data vectors in DataWindow.PBL.

2, programming points:

· First plan, the post-implementation is the necessary steps, in the understanding of the basic algorithm, then implement the programming, there will be a relatively clear understanding rather than what to do. In software engineering

System design;

· With PFC programming technology, the application development time can be greatly shortened, especially for complex applications;

· If it is involved in database development, you must first do a good job in database design (functional specification);

· Do not be too long, multi-use loosely coupled functions and events to enhance reuse;

· Write annotations, especially complicated logic. The format I always use is:

/ ************************************************** **********************************************

Features:

parameter:

logic:

Be applicable:

Programming:

Create: 1999.09.21

Modification: 2000.09.21

Version: 1.0

*********************************************************** ********************************************* /

转载请注明原文地址:https://www.9cbs.com/read-3755.html

New Post(0)