A block consists of a series of declarations followed by a compound statement. All declarations must occur together at the beginning of the block. So the form of a block is

  • declarations} begin
  • statements} end

The declarations section can include, in any order, declarations for variables, constants (including resource strings), types, procedures, functions, and labels. In a program block, the declarations section can also include one or more exports clauses (see Libraries and packages).

For example, in a function declaration like function UpperCase(const S: string): string; var

Ch: Char; L: Integer; Source, Dest: PChar; begin end;

the first line of the declaration is the function heading and all of the succeeding lines make up the block. Ch, l, Source, and Dest are local variables; their declarations apply only to the Uppercase function block and override, in this block only, any declarations of the same identifiers that may occur in the program block or in the interface or implementation section of a unit.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment