Function TTautotest.getObj: Olevariant;
VAR T: TDATACLASS;
MS: TMEMORYSTREAM;
Begin
T: = TDATACLASS.CREATE (NIL);
MS: = TMEMORYSTREAM.CREATE
Try
T.SaveTostream (MS);
Result: = VararrayCreate ([0, Ms.Size-1], Varbyte);
Ms.Position: = 0;
Ms.Readbuffer (Vararraylock (Result); ms.size
Finally
T.free;
Ms.free;
Vararrayunlock (Result);
END;
END;