File: ok_attributes.pas

package info (click to toggle)
pasdoc 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,992 kB
  • ctags: 2,308
  • sloc: pascal: 26,085; makefile: 434; sh: 343; xml: 21
file content (26 lines) | stat: -rw-r--r-- 607 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ Simple Delphi attributes test, from http://www.malcolmgroves.com/blog/?p=530 }
unit ok_attributes;

interface

type
  TPerson = class
  private
    FName: String;
    FAge: Integer;
  public
    [NonEmptyString('Must provide a Name')]
    property Name : String read FName write FName;
    [MinimumInteger(18, 'Must be at least 18 years old')]
    [MaximumInteger(65, 'Must be no older than 65 years')]
    property Age : Integer read FAge write FAge;
  end;

  // Test that GUIDs are handled gracefully
  IUIContainer = interface
  ['{0F0BA87D-95C3-4520-B9F9-CDF30015FDB3}']
  end;

implementation

end.