simpleSoft
April 15th, 2004, 12:28 AM
More OOP woes...
Here is what I want to do...extend the String class
class example extends String {}
and then I want to take things that are already strings and add a function to them which goes through and removes & and turns it back to & am things got some test code for that here
function htmlToString():Void {
var args:Array = new Array();
args = this.split("&");
this = args.join("&");
args = this.split("'");
this = args.join("'");
args = this.split(""");
this = args.join('"');
args = this.split("<");
this = args.join('<');
args = this.split(">");
this = args.join('>');
}
But when I go and compile it I get error msg's like this
Line 13: Type mismatch in assignment statement: found String where htmlString is required.
this = args.join('>');
Here is what I want to do...extend the String class
class example extends String {}
and then I want to take things that are already strings and add a function to them which goes through and removes & and turns it back to & am things got some test code for that here
function htmlToString():Void {
var args:Array = new Array();
args = this.split("&");
this = args.join("&");
args = this.split("'");
this = args.join("'");
args = this.split(""");
this = args.join('"');
args = this.split("<");
this = args.join('<');
args = this.split(">");
this = args.join('>');
}
But when I go and compile it I get error msg's like this
Line 13: Type mismatch in assignment statement: found String where htmlString is required.
this = args.join('>');