Forum Discussion
googleid_105613
11 years agoOccasional Contributor
What's happening in that article you posted a link to is they're exposing a VB.NET object to use within TestComplete, and then creating a .NET Interop object to allow that .NET component to communicate to TestComplete via COM. From what I could understand from your post, not exactly what you wanted. But here's what you can do...
In JScript, you can create objects. It's a little weird, but it works.
You create your object like this...
function foo ()
{
this.bar=function(x)
{
//Do some
}
this.Prop1="some value";
}
so further down you can say...
var myFoo=foo;
foo.Prop1="blahblahblah";
It's not true OOP, like you'd expect. You may get into trouble with inheritance. Do some research on OOP in Javascript. Remember that the JScript engine is based on Microsoft's JScript engine, which may not be entirely ECMA compliant.
Yes, you can define an object in one unit, and include that unit in another through a //USEUNIT and use it in a second unit. You can return "objects" from function calls and use them as well.
In JScript, you can create objects. It's a little weird, but it works.
You create your object like this...
function foo ()
{
this.bar=function(x)
{
//Do some
}
this.Prop1="some value";
}
so further down you can say...
var myFoo=foo;
foo.Prop1="blahblahblah";
It's not true OOP, like you'd expect. You may get into trouble with inheritance. Do some research on OOP in Javascript. Remember that the JScript engine is based on Microsoft's JScript engine, which may not be entirely ECMA compliant.
Yes, you can define an object in one unit, and include that unit in another through a //USEUNIT and use it in a second unit. You can return "objects" from function calls and use them as well.
Related Content
- 8 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago