Quote:
Originally Posted by Chompy
But whatever I named the TStaticVar, I wouldn't get the object name of the second TStaticVar or the 'sub-object'
|
Ugh, the concept is amazingly simple you know, and I'm rather irritated at your lack of understanding about something I thought you would have known.
new Object(Name);
The object can be an existing one, in which case all editable variables will be copied including its joined classes, and the copied object will be of the same type as the original. Or if its the name of an object type, a new instance of that type will be created.
If you've ever made new GuiProfiles it would be simple to understand.
PHP Code:
function onCreated() {
obj = new TStaticVar("TestObject");
obj.foo = "bar";
obj2 = new TestObject();
}
PHP Code:
function onCreated() {
obj = new TStaticVar("TestObject");
obj.foo = "bar";
obj2 = new TStaticVar();
obj2.copyfrom(obj);
}
Both are doing the exact same thing.