end (reserved word)


 end (reserved word)

The reserved word end is used with

  - begin to form compound statements
  - case to form case statements
  - record to declare record types
  - object to declare object types
  - asm to call the built-in assembler


 (* with "begin" to form compound statement *)
 if First < Last then
   Temp := First;
   First := Last;
   Last := Temp;

 (* with "case" statement *)
 case Ch of
   'A'..'Z', 'a'..'z':  WriteLn('Letter');
   '0'..'9':            WriteLn('Digit');
   '+', '-', '*', '/':  WriteLn('Operator');
   WriteLn('Special character');

 (* with record type definitions *)
   Class  = (Num, Dat, Str);
   Date   = record
     D, M, Y: Integer;
   Facts = record
     Name: string[10];
     case Kind: Class of
       Num: (N: real);
       Dat: (D: Date);
       Str: (S: string);

 (* with object type definitions *)
   LocationPtr = ^Location;
   Location = object
     X, Y: Integer;
     procedure Init(PX, PY: Integer);
     function GetX: Integer;
     function GetY: Integer;

 (* with asm *)
   mov ax,1
   mov cx, 100

Тэги: end
| G+
Код для вставки: :: :: :: ::
Поделиться: // //