File: ok_record_with_case.pas

package info (click to toggle)
pasdoc 0.16.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,572 kB
  • sloc: pascal: 28,894; javascript: 7,665; xml: 2,597; makefile: 523; sh: 417
file content (55 lines) | stat: -rw-r--r-- 1,455 bytes parent folder | download | duplicates (6)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ @abstract(Testing of parsing and making docs for records with case parts.)

  It does not pass properly yet:
  @orderedList(
    @item(Types for fields in record case are not printed
      (because parser does not set their FullDeclaration properties).)
    @item(Also, CaseTwoB field has no description (but it should have 
      "Description of CaseTwoA and CaseTwoB"))
  )
  
  Update 2005-10-17: now this test passes OK, both problems above
  are solved.
}

unit ok_record_with_case;

interface

type
  TMyRecord1 = record
    { Description of NormalField }
    NormalField: Integer;
    { Description of CaseDecision }
    case CaseDecision: boolean of
      false: (
        { Description of CaseOneSingle }
        CaseOneSingle: Single);
      true: (
        { Description of CaseTwoSingle }
        CaseTwoSingle: Single;
        { Description of CaseTwoInt }
        CaseTwoInt: Integer;
        { Description of CaseTwoA and CaseTwoB }
        CaseTwoA, CaseTwoB: Integer);
  end;

  TMyRecord2 = record
    { Description of NormalField }
    NormalField: Integer;
    case boolean of
      false: (
        { Description of CaseOneSingle }
        CaseOneSingle: Single);
      true: (
        { Description of CaseTwoSingle }
        CaseTwoSingle: Single;
        { Description of CaseTwoInt }
        CaseTwoInt: Integer;
        { Description of CaseTwoA and CaseTwoB }
        CaseTwoA, CaseTwoB: Integer);
  end;

implementation

end.