Ok, I know how to do this, I am just hoping that there is an easier way before I write the long case statements required . Basically for my TTCPServer for SDL I want to add support for Variants. This means writing the size of the variant and then the data block. Why go through all this trouble and not just write a full sized variant? Simple effeciency on the pipe. If I can get away with writing 2 bytes (integer) instead of 255 bytes (string) then I'm better off. Not to mention that SizeOf doesn't work on AnsiString Variants .

Seems like you used to be able to do something like:[pascal]
var
varData : Tvardata;
varSize : Cardinal;
varPtr : Pointer;
begin
varData := TVarData(V);
varSize := varData.Size;
varPtr := @varData.vbytes[0];
end;[/pascal]

But this doesn't seem to work any more, of course I'm a bit rusty on Variants. Right now I'm not looking at variant arrays, I know they require loops and scanning of the entire variant record type. Any ideas on an effecient way instead of hand coding every single frigging thing?