Global property purpose is to hide the implementation. And if you use a global variable, then it must already be somewhere explicitly defined above, so there is already a direct access to this variable and the property is not needed.
Wow, that makes sense, it's very well thought out..
I think it's a error. The code is compiled using {$MODE DELPHI} or {$MODESWITCH CLASSICPROCVARS}
I rechecked it with the delphi mode and that switch, it still didn't compile, so i guess you're right about it being an error..
Also, i forgot to ask it before but is there any way of having multiple variant parts in a record (Other than doing the below)?
rec = record
a : integer;
b : char;
c : word;
variantPart1 : record
case opt: word of
1: (abc : LongInt;);
2: (def : LongWord;);
3: (fgh : array[0..3] of char;);
end;
case variantPart2 : word of
1: (ghj: array[0..7] of char;);
2: (jkl: array[0..1] of Longint;);
end;
I have to go through variantPart1 before i can access it's data, is there any alternative way to solve this?
Thank you..