TVarRec, TVarData???

Giganews Newsgroups
Subject: TVarRec, TVarData???
Posted by:  Dion (di…@mighty.co.za)
Date: Wed, 29 Mar 2006

Hi,

When do I use TVarRec and TVarData?

Is the following correct?

procedure DoSomething(aArray: array of const);
var
  aTotArray: array of variant;

begin
    TVarData(aTotArray[1]).VType := varInteger;
    TVarData(aTotArray[1]).VInteger := 123;

    TVarData(aTotArray[2]).VType := varCurrency;
    (Why not  -  aTotArray[2]).VType := vtCurrency; )
    TVarData(aTotArray[2]).VCurrency := TVarData(aArray[2]).VCurrency;
    (Why not  -  aTotArray[2]).VCurrency := aArray[2]).VCurrency;  )
end;

Thanks,
Dion

Replies