Forum Discussion

kumar_perlaa's avatar
kumar_perlaa
Contributor
13 years ago

Can i create classes,Objects and Inheritence Implementation in Jscript V5.7...?



Hello Tanya/Alex,



Can i create classes and it's objects in JScript V5.7?



I just wanna know TC supported features of JScript V5.7. Can you please help me regarding this?



Below is the Jscript Code Snipet :


class Person {



 



protected var name : String;



 



function get Name() : String {



return this.name;



}



 



function set Name(newName : String) {



if (newName == "")



throw "You can't have a blank name!";



this.name = newName;



}



function sayHello() {



return this.name + " says 'Hello!'";



}



}



var fred : Person = new Person();



fred.Name = "Fred";



Log.Message(fred.sayHello());



 



OutPut:



Fred says Hello!