Hi all!
I tried to make use of the persistent variable (vector) feature and failed.
After a restart of DO, the vector saved into DOpus.Vars exists, but is of zero length.
Any hints appreciated, in case it's me being the faulty part. o)
Thx!
Demo-Code:
//DOpus.Vars.Delete("MyVector");
if (DOpus.Vars.Exists("MyVector")){
DOpus.Output("MyVector exists");
var myVector = DOpus.Vars.Get("MyVector");
DOpus.Output(" Retrieved Vector persistency: " +DOpus.Vars("MyVector").persist);
DOpus.Output(" Retrieved Vector length: " +myVector.length);
DOpus.Output(" Retrieved Vector(0): " +myVector(0)(0) + " - "+ myVector(0)(2));
//DOpus.Output(" Retrieved Vector(0): " +myVector(0));
DOpus.Output(" Retrieved Vector(1): " +myVector(1));
DOpus.Output(" Retrieved Vector(2): " +myVector(2));
//DOpus.Vars.Delete("MyVector");
} else {
DOpus.Output("Creating MyVector (now run again)");
var v = DOpus.Create.Vector();
var subV = DOpus.Create.Vector();
subV.push_back( "subVal1");
subV.push_back( "subVal2");
subV.push_back( "subVal3");
v.push_back( subV );
v.push_back( "mystring2");
v.push_back( "mystring3");
DOpus.Vars("MyVector") = v;
DOpus.Vars("MyVector").persist = true;
DOpus.Output(" Vector persistency: " +DOpus.Vars("MyVector").persist);
}