Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread HOWTO: External Interface to Namespace ?
Tue, May 24 2016 9:10 PMPermanent Link

Trinione

Hi:
I know how to access regular functions, however I cannot figure out how to access Namespaces.

Any help would be appreciated.

--------------------------------------------
Filename: MyExternalJS.js
--------------------------------------------
function MyApplication () {

 this.sum = function(a, b) {
   return a + b;
 };

 this.reset = function() {
   this.var1 = 0;
   this.var2 = 0;
   return this.var1 + this.var2;
 }
};

var myApp = new MyApplication();
myApp.var1 = 4;
myApp.var2 = 6;

console.log(myApp.sum(myApp.var1, myApp.var2));
console.log(myApp.reset());
console.log(myApp.sum(myApp.var1, myApp.var2));
Wed, May 25 2016 12:40 AMPermanent Link

Trinione

Never mind.

Other posts in the forum explain it sufficiently.
Image