Here is a piece of code simplified to show case my frustration.
Type
TMyExtremelyLongRecordOfIntegerOnlyfields = packed Record
case integer of
1: (W1,W2 ...Wn :Word);
2:(DW1,DW2...DW(n/2):DWord);
3:(DW1,DW2:DWord;W1,W2:Word; B1..B((n-6)*2):byte);
end;
end;
const
cMyNullRec : TMyExtremelyLongRecordOfIntegerOnlyfields = (DW1 =0;DW2=0;..DW(n/2) =0);
So far so good, now considered a number of procedures that use that record as parameter and for some of them I can work with out the record as well so I have something like
procedure Proc1(var1,var2..VarN; MyRec:TMyExtremelyLongRecordOfIntegerOnlyfields = (dw1=0;dw2=0;......dw(n/2) = 0)
You get the picture I suppose. It would make my life easier if I didn't had to copy paste those pesky zeros around, I like the simplicity of just using a const for those cases and by changing that const I know that the rest of the code, that depends on it, will keep working as indented.
As I said it is not a big deal the usage count of that record's default value is less than 10 I was just trying to improve the code and remove any potential booby-traps for future development, I'll just change those cases to PMyExtremelyLongRecordOfIntegerOnlyfields and use the nil value for default that will have better effect than the const theory.