Quartz Composer JavaScript Reference © Cybero Designs  

this

Type Statement Operator
Formatthis This
Commentary
In general, in a method, this refers to the calling object.
Sample code - QC 2 JavaScript
function calc(a,b) function calc (a, b)
(
this.mul = a * b;
this.div = a / b;
this.add = a + b;
this.sub = a - b;
)
cObj = new calc (2,3);
outputs [0] = "Addition result is" + cObj.add + "is";
Sample code - QC 3 JavaScript
function (__string outputNumber) main (__number inputNumber[2])
{
var result = new Object();
function calc(a,b)
{
this.mul = a * b;
this.div = a / b;
this.add = a + b;
this.sub = a - b;
}
cObj = new calc(2,3);

result.outputNumber = "Number "+cObj.add+" Results";
return result;
}

Return to the Start Page