Some example code below
PHP Code:
public function load(pl,id)
{
obj.(@pl@"_"@id) = new TStaticVar();
obj.(@pl@"_"@id).loadvars(some file);
}
public function save(pl,id)
{
obj.(@pl@"_"@id).savevars(some file, 0);
obj.(@pl@"_"@id).destroy();
}
It seemingly worked well until i noticed that obj retained dynamic vars. When I used my getinfo command on it, I found this
PHP Code:
Object Type: obj.Twinny_1 = 0
Static Vars: 0
Dynamic Vars: 0
compared to an active one
PHP Code:
Object Type: obj.Twinny_1 = TStaticVar
Static Vars: initialized,joinedclasses,name,scriptlogmissingfunctions,timeout
Dynamic Vars: somethingsecret,
Any reason why the first object should retain the name of the destroyed var? I tried doing obj.clearvars(); and obj = ""; as well as the destroy. Doing obj = ""; is bad since it seems to create a TGraalVar object.
Any hints?