View Single Post
  #13  
Old 06-21-2007, 02:21 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to 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?
__________________

Coming soon (Hopefully:P)
Reply With Quote