This shows, very briefly, ways in which each Pascal or Delphi reserved word or directive is used; it cannot act as a tutorial in their use, but may serve as a reminder of words and usage. Where the entry is "*", I have as yet thought of nothing short and useful.
Notes :-
In | Reserved Word | Example of usage |
---|---|---|
BP7 | and | BV := BV1 and BV2 ; J := K and L |
BP7 | array | var X : array [type] of type |
D3 | as | |
BP7 | asm | asm assembler code end |
BP7 | begin | begin statements end |
BP7 | case | case N of 1: statement; 2: statement; else statement end |
D3 | class | |
BP7 | const | const X=3; const Y: byte=4 |
BP7 | constructor | constructor Method (<parameter list>) |
BP7 | destructor | destructor Method |
D3 | dispinterface | |
BP7 | div | I := J div K |
BP7 | do | see for, while, with |
BP7 | downto | for J := 5 downto 1 do statement |
BP7 | else | see case, if |
BP7 | end | see asm, begin, case, object, record |
D3 | except | |
BP7 | exports | * |
BP7 | file | var F : file ; G : file of type |
D3 | finalization | |
D3 | finally | |
BP7 | for | for J := 1 to 5 do statement |
BP7 | function | function Q(const C:char; J:shortint) : char |
BP7 | goto | goto L |
BP7 | if | if BV then statement else statement |
BP7 | implementation | * |
BP7 | in | BV := element in set |
BP7 | inherited | * |
D3 | initialization | |
BP7 | inline | inline($9C) ; inline($58/$F7/$E8) |
BP7 | interface | * |
D3 | is | |
BP7 | label | label L |
BP7 | library | library DLLname |
BP7 | mod | I := J mod K |
BP7 | nil | P := nil |
BP7 | not | BV := not BV1 |
BP7 | object | type Tob = object (Tx) W:word; B,C:byte end |
BP7 | of | see array, case, file, set |
BP7 | or | BV := BV1 or BV2 ; J := K or L |
D3 | out | |
BP7 | packed | var X : packed record ... end |
BP7 | procedure | procedure A(var B:byte; const C:char; J:shortint) |
BP7 | program | program ProgName |
D3 | property | |
D3 | raise | |
BP7 | record | type Tr = record W:word; B,C:byte end |
BP7 | repeat | repeat statements until BV |
D3 | resourcestring | |
BP7 | set | type Ts = set of 'A'..'Z' |
BP7 | shl | J := K shl 3 |
BP7 | shr | J := K shr 3 |
BP7 | string | var S1:string; S2: string[33] |
D3 | stringresource | |
BP7 | then | see if |
D3 | threadvar | |
BP7 | to | for J := 1 to 5 do statement |
D3 | try | |
BP7 | type | type Tx = 1..7 ; Ty = (red, green, blue) |
BP7 | unit | unit UnitName |
BP7 | until | repeat statements until BV |
BP7 | uses | uses Dos, Crt |
BP7 | var | var J : integer |
BP7 | while | while BV do statement |
BP7 | with | with P^ do statement |
BP7 | xor | BV := BV1 xor BV2 ; J := K xor L |
Note that names such as byte, real, ... (see Pascal / Delphi / + Types) and those of the standard procedures & functions are not reserved words; but it is usually bad practice to redefine them.
In | Directive | Example of usage |
---|---|---|
BP7 | absolute | var Tix : word absolute $40:$6C ; Tox : byte absolute Tix |
D3 | abstract | |
BP7 | assembler | procedure directive |
D3 | automated | |
D3 | cdecl | |
D6 | deprecated | const S = 'V' deprecated ; |
D3 | default | |
D3 | dispid | |
D3 | dynamic | |
BP7 | export | procedure directive |
BP7 | external | procedure directive |
BP7 | far | procedure directive |
BP7 | forward | procedure directive |
BP7 | index | used in an exports clause |
BP7 | interrupt | procedure directive (not D3) |
D3 | message | |
D3 | name | |
BP7 | near | procedure directive |
D3 | nodefault | |
D3 | override | |
D3 | pascal | |
BP7 | private | used in objects |
D3 | protected | |
BP7 | public | used in objects |
D3 | published | |
D3 | read | |
D3 | readonly | |
D3 | register | |
BP7 | resident | used in an exports clause |
D3 | safecall | |
D3 | stdcall | |
D3 | stored | |
BP7 | virtual | procedure directive |
D3 | write | |
D3 | writeonly |
Directives can, but should not, be redefined.
In | Keyword | Example of usage |
---|---|---|
D6 |