| 123456789101112131415161718192021222324252627282930313233343536 |
- program t63_record;
- { t63 -- record TYPES: field list, non-compacted layout, and the size. CALC's
- record is CALC.PAS:126:
- CellRec = record
- CellStatus : set of Attributes; -- 1: set of 0..5, one byte
- Contents : String[70]; -- 71: length byte + 70
- Value : Real; -- 6
- DEC, FW : 0..20; -- 1+1: a subrange with both bounds
- in 0..255 is ONE byte
- end; -- = 80
- Section 3 of CALC-COMPILE.md measured CellRec at 80 from the original's data
- report, so "data=84" here (CellRec 80 + the two @@T temporaries) IS the
- assertion that the layout is right: a difference of one byte in any field
- moves it. Subrange sizing is load-bearing for the same reason: "0..20" must
- be one byte, per RESUME-TP3.md section 2, or CellRec would be 82 and Sheet
- 240 bytes too big.
- Field SELECTION ("c.DEC", "Sheet[FX,FY].CellStatus") is the next increment;
- today it is a loud error, not a wrong address. }
- type
- Attributes = (Constant, Formula, Txt, OverWritten, Locked, Calculated);
- CellRec = record
- CellStatus : set of Attributes;
- Contents : String[70];
- Value : Real;
- DEC, FW : 0..20;
- end;
- var
- c : CellRec;
- begin
- writeln ('a CellRec is 80 bytes')
- end.
|