JScript Examples |
The JScript version of the VBScript Examples is shown below.
function ScriptObjEvent::Start()
{
// TODO: Add code here
}
function ScriptObjEvent::Exec(inputs,outputs)
{
var dataval;
for ( i=0; i<Inputs.Count; i++ )
// look at each dataval in the collection
dataval = Inputs(i)
// show what we found
alert("Input: " + i.toString() + ", Value: " + dataval.Value(0,0).toString());
// pass inputs on to outputs, incrementing
// first element by one
if ( i<Outputs.Count )
{
Outputs(i).Value = dataval.Value;
Outputs(i).Value(0,0) += 1 ;
}
}
function ScriptObjEvent::Stop()
{
// TODO: Add code here
}