### Define a Type

Posted:

**15 Sep 2011, 19:51**Jscript can group a group of variables into a type definition.

I created this simple program. It adds 3 numbers.

// create a type

function AddTheseNumbers(first,second,third) {

this.One = first;

this.Two = second;

this.Three = third;

}

function OnComputeOutputs(params)

{

var First = params.ConValue('First');

var Second = params.ConValue('Second');

var Third = params.ConValue('Third');

var NewList = new AddTheseNumbers(First, Second, Third);

var NewAdd = AddNumbers(NewList);

params.ConValue('AddResult') = NewAdd;

}

function AddNumbers(ListofNumbers)

{

return (ListofNumbers.One + ListofNumbers.Two + ListofNumbers.Three);

}

I created this simple program. It adds 3 numbers.

// create a type

function AddTheseNumbers(first,second,third) {

this.One = first;

this.Two = second;

this.Three = third;

}

function OnComputeOutputs(params)

{

var First = params.ConValue('First');

var Second = params.ConValue('Second');

var Third = params.ConValue('Third');

var NewList = new AddTheseNumbers(First, Second, Third);

var NewAdd = AddNumbers(NewList);

params.ConValue('AddResult') = NewAdd;

}

function AddNumbers(ListofNumbers)

{

return (ListofNumbers.One + ListofNumbers.Two + ListofNumbers.Three);

}