I have this simple code.
program test;
type abc = variant;
begin
end.
If I compile it, the compiler includes the Variants unit, even though
the variant type is declared in the System unit.
The above code doesn't even refer the variant type as a variable, so
there no need for variant variable initialization. There should be no
variant related code to be included in the program at all.
JJ wrote:
I have this simple code.
program test;
type abc = variant;
begin
end.
If I compile it, the compiler includes the Variants unit, even though
the variant type is declared in the System unit.
The compiler does nothing of this sort, it is the IDE when you save the program file (which it does automatically when you ask it to compile
the code).
The above code doesn't even refer the variant type as a variable, so
there no need for variant variable initialization. There should be no
variant related code to be included in the program at all.
So what? In any real code that actually *uses* your abc type you will
need variant support routines. Your example is completely artifical.
You could try to use OleVariant instead of Variant, if you already have Windows in the Uses clause anyway.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (2 / 14) |
Uptime: | 10:16:31 |
Calls: | 6,644 |
Calls today: | 4 |
Files: | 12,190 |
Messages: | 5,326,492 |