Object-type constants

Language:
Русский
English

  Object-type constants


The declaration of an object-type constant uses the same syntax as the declaration of a record-type constant.

No value can be specified for method components.

Examples

 const
   ZeroPoint: Point = (X: 0; Y: 0);
   ScreenRect: Rect = (A: (X: 0; Y: 0); B: (X: 80; Y: 25));
   CountField: NumField = (X: 5; Y: 20; Len: 4; Name: nil;
     Value: 0; Min: -999; Max: 999);

Constants of an object type that contains virtual methods do not need to be initialized through a constructor call--this initialization is handled automatically by the compiler.

Код для вставки: :: :: :: ::
Поделиться: // //