Originale-mail to me for new edition

 

The block

 

The block contains a simple or structured statement that is executed when the program runs. In most programs, the block consists of a compound statement bracketed between the reserved words begin and end whose component statements are simply method calls to the project’s Application object. (Every project has an Application variable that holds an instance of TApplication, TWebApplication, or TServiceApplication.) The block can also contain declarations of constants, types, variables, procedures, and functions; these declarations must precede the statement part of the block.

 

Topic groups

Programs and units: Overview

Program structure and syntax: Overview

The program heading

The program uses clause

The block

Unit structure and syntax: Overview

The unit heading

The interface section

The implementation section

The initialization section

The finalization section

Unit references and the uses clause

The syntax of a uses clause

Multiple and indirect unit references

Circular unit references

 

See also

Program structure and syntax: Overview

The exports clause

The program heading

The program uses clause

 

 

译文

 

 

块就是程序运行时将被执行的一个简单语句(如赋值、调用对象实例的方法等)或结构化的语句(如循环控制等)。在大部分程序(这里特指program)中,块由一组由保留字beginend扩起来的混合语句组成,这些混合语句通常只是对工程中Application对象的方法进行简单调用。(每个工程都有一个Application变量,用于保存TApplicationTWebApplication、或TServiceApplication其中之一的实例。)块也可以含有各种声明,如常量、类型、变量、过程以及函数等,但这些声明必需位于块中语句部分之前(就象传统的Pascal编程中主程序的结构)。

 

主题组

程序和单元:概述

程序结构和语法:概述

程序首部

程序的uses子句

单元结构和语法:概述

单元首部

接口节

实现节

初始化节

结束节

单元引用和uses子句

uses子句的语法

多重和间接单元应用

循环单元引用

 

相关主题

程序结构和语法:概述

exports子句

程序首部

程序的uses子句

 

 

编者注

一般情况下不要手工编辑工程文件,IDE会自动维护该文件的源代码,因此建议将应用程序的逻辑控制科学合理地分布到各单元中。如果确实需要在工程文件中添加一些特别的程序逻辑(如在调用Application对象的方法之前检查应用程序实例是否已经在运行中,以便决定是否加载新的应用程序实例)时,也应当尽量将语句封装在过程、函数或对象实例中,并且这些过程、函数或对象的声明和定义也不要置于工程文件中,在工程中仅根据需要进行简单调用即可。如若不然,那么工程文件将显得臃肿,而且逻辑结构也欠清晰。