View Single Post
  #14  
Old 06-21-2007, 02:32 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by JkWhoSaysNi View Post
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?
__________________
Reply With Quote