Difference between revisions of "Begin"
From Lazarus wiki
Jump to navigationJump to search (more detail ; wikify) |
m |
||
Line 1: | Line 1: | ||
The [[keyword]] '''begin''' is used to indicate the start of the executable section of a [[function|FUNCTION]], [[method]] of an [[object|OBJECT]], [[procedure|PROCEDURE]], [[program|PROGRAM]], [[property]] of an object, or is used to delineate the start of a [[block]] statement. | The [[keyword]] '''begin''' is used to indicate the start of the executable section of a [[function|FUNCTION]], [[method]] of an [[object|OBJECT]], [[procedure|PROCEDURE]], [[program|PROGRAM]], [[property]] of an object, or is used to delineate the start of a [[block]] statement. | ||
− | For a function, method, procedure, program, or property, it is used after all [[CONST]], [[TYPE]] and [[VAR]] declarations, and before the first executable statement. It is always terminated by an [[ | + | For a function, method, procedure, program, or property, it is used after all [[CONST]], [[TYPE]] and [[VAR]] declarations, and before the first executable statement. It is always terminated by an [[End|END]] statement: |
'''program''' Project1; | '''program''' Project1; | ||
Line 20: | Line 20: | ||
'''end'''; | '''end'''; | ||
− | A '''begin''' ''must'' be closed with '''[[end]]'''. | + | A '''begin''' ''must'' be closed with '''[[End|end]]'''. |
{{Keywords}} | {{Keywords}} | ||
{{Stub}} | {{Stub}} |
Revision as of 21:26, 9 January 2007
The keyword begin is used to indicate the start of the executable section of a FUNCTION, method of an OBJECT, PROCEDURE, PROGRAM, property of an object, or is used to delineate the start of a block statement.
For a function, method, procedure, program, or property, it is used after all CONST, TYPE and VAR declarations, and before the first executable statement. It is always terminated by an END statement:
program Project1; var(..); begin (..); end.
For a block statement, it delineates the top of the block, and is also terminated by an END statement:
if (..)then begin (..) end else begin (..) end;
A begin must be closed with end.
Keywords: begin — do — else — end — for — if — repeat — then — until — while