
06-21-2007, 02:32 PM
|
|
¯\(º_o)/¯
|
 |
Join Date: Sep 2006
Location: Norway
Posts: 2,815
|
|
Quote:
Originally Posted by JkWhoSaysNi
Interesting ideas. I can't seem to get it to work. I'm trying to implement function inheritance but I can't even get your example to work:
PHP Code:
function parent(strName) {
with(obj = new TStaticVar()) {
this.someFunction = function() {
this.someVar = 4;
};
}
return obj;
}
function child(strName) {
with (parent(null)) {
someFunction = function() {
someFunction();
this.someVar += 2;
};
return this;
}
}
function onCreated() {
test = parent("test");
echo(test.getVarNames());
echo(test.getFunctions());
test.someFunction();
echo(test.someVar);
}
Here, test.getVarNames(); lists someFunction but getFunctions does not. When someFunction() is called an error appears in RC: Function unknown_object.someFunction not found at line 24 in script
Any ideas?
|
Try name the TStaticVar? |
|
|
|