First of all, I hope I understand your question correctly.
You have something like this:
class Manager
properties
Employees
end
end
class Employee
end
You have an instance of Manager
manager = Manager();
e1 = Employee();
e2 = Employee();;
manager.Employees{1} = e1;
manager.Employees{2} = e2;
And you want to save it.
In this case, even if you don't have e1
and e2
in your workspace, save command will save them while saving Manager
.
However, in order to load them correctly, you must have both Employee
and Manager
in your working directory. That makes sense, because there is no other way knowing what kind of class it was. In fact, you will get an error:
Warning: Variable 'manager' originally saved as a Manager cannot be instantiated as an object and will be read in as a uint32.
Warning: Variable 'e1' originally saved as a Employee cannot be instantiated as an object and will be read in as a uint32.
Warning: Variable 'e2' originally saved as a Employee cannot be instantiated as an object and will be read in as a uint32.