ZT: Delphi programming specification 1.0.0.0 (YCKXZJJ)

zhaozj2021-02-12  187

Writing Objectives This specification is defined as program files and coding styles involved in the process of writing. This specification is based on the Delphi language. The organization of the project file is organized in Delphi, and the program file is organized according to the project. In a typical project, including: project file (.drp file) contains the PASCAL source code for the engineering main program; unit file (.PAS file) project, the PASCAL source file of each form, contains all the declarations of the form and Process (including time processing); Form file (.dfm file) contains binary files for design properties of a form, each form of .dfm files correspond to .pas files; resource files (.res files) compile The binary resource file is linked to the application's executable; the project option file (.dof file) stores the project options set by the Project | Options menu command; the desktop settings file (.dsk file) stores Tools | Options The menu command sets the desktop options set; the package file (.dpk / .bpl file) is used to share components, classes, data, and code files. The source file is a .dpk file, compiled for .bpl files; constant definition content: Declining of logical values; definition of constant value; definition of error code; format: One definition occupies a line. As follows: Const : Type = value; // Note Description: Use the const statement to declare the constant used to replace the text value. Example: const c_sql: string = 'select ch_USERER_ID from T_CD_USER'; // Query User ID Const C_PI: Real = 3.1415926; // Performance Rate Structure Type Definition Content: Structure Type Definition Format: Type // Structure Description Note < Variable Name 1>: Variable Type; // Variable Description Note : Variable Type; // Variable Description Note ... END; Description: is a string starting with uppercase letters. The statement defined in the structural definition is starting from the second line of the fifth column. Example: type TableList = Record // System Tree unit Type Definition InID: Integer; // Unit Number Name: String; // Unit Name PID: String; // Previous Unit Name Pt: PtableList; // Refers to the next unit Type pointer END; Program style Program style specifies the positioning rules and procedures in each statement. Function / Procedure Style Name (Variable: Variable Type [, ...]); // Function / Procedure Description VAR Variable 1: Variable Type; // Variable Description Variable 2: Variable Type; // Variable Description ... begin statement; statement; ... End; Note: Variable declaration, statement is written from the third column, if there is indent, each indent two columns, and aligned with relative statements. Statement Style Description: There is usually a paragraph function explanation in the program body; the specification uses various statements; the indentation in the statement is in two listed as a unit.

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

New Post(0)