This seems to work for me. I created a gain block with %var="foo" and connected the IO to the "system".
In Xmath, I did the following:
foo=3;
t1=[0:.1:5]'; u1=sin(t1);
[,y1]=sim("system",t1,u1,{resumeto="f.dat"});
plot(t1,y1); #{ This showed a sine with gain of 3 }#
foo=12;
t2=[5:.1:10]'; u2=sin(t2);
[,y2]=sim("system",t2,u2,{resumefrom="f.dat"});
plot([t1;t2],[y1;y2]);
This showed a sine with gain of 3 for the first 5 seconds followed by a sine with gain of 12 for the next 5 seconds. It reported that it was resuming from "f.dat" and it also stated that it was using
%var "foo".
What block is using your %var? I know that there were issues with resume with Continuous Time Delay. Please send me more information and I'll figure out what is going on.