shared numbervar lastVal;
shared numbervar thisVar;
if NOT ISNULL(thisVar) then
lastVal := thisVar;
//do logic to get this thisVar
I would probably do this where the vol_mid is defined, then you can reference the lastVal variable in the other formulas. just need to add:
shared numbervar lastVal;
to the formulas
HTH