Link to home
Start Free TrialLog in
Avatar of flooder
flooder

asked on

Saving a variant type with a stream

var
  VarArr: Variant;
  gh:^widestring;
begin
  VarArr:=VarArrayCreate([0,1],varVariant);
  VarArr:=Table2['Alpha;Graphic'];
 
  label1.caption:=inttostr(vartype(VarArr[1]));
 
My question is I need to save the image data through a variant array i cant use anything else. The problem is the variant array returns a reference to a widestring(that is what the label1 is telling us)how do i manage to assign the reference to a pointer or something so i can get the data to save to a stream. What i want to achieve is something like this but it does not work   gh:=pointer(vararr[1]);
ASKER CERTIFIED SOLUTION
Avatar of Lischke
Lischke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jonnyfive
jonnyfive

Hi flooder...

as I have seen in your other posting, you are looking for something like this:

procedure SaveVariant(AnyVar: Variant; Filename : String);
function LoadVariant(Filename : String): Variant;

And, of course, it should save everything in the variant, including any arrays in it. Well, sounds like an intresting pet project :-] Well, I might have some time this weekend and see if I can do something like that (should be possible :-])...

Cya, Jonny...
Avatar of flooder

ASKER

Thanks for the help.
The other question still runs.