I'm trying to learn about scripting.
To start I opened the script
simplest callback example which displays the index of the last input whose value has been modified.
I would like to :
1) to be able to add an output that would display the value of the last modified input
2) to reproduce the same script but with an array input.
Thank you to enlighten me.
Here attached the script :
Code: Select all
//////////////////////////
//Simplest Callback exemple: check wich in changed
/////////////////////////
var In1 , In2 , In3 : Tparameter;
var inputChanged : Tparameter;
var ChangedValues : Tparameter;
//////////////////////////////////////
// Init is started on script compilation to create the in/outs
PROCEDURE INIT;
BEGIN
In1:= CreateParam('Input1',PtDataField,pioInput);
In2:= CreateParam('Input2',PtDataField,pioInput);
In3:= CreateParam('Input3',PtDataField,pioInput);
InputChanged:= CreateParam('InputChanged',PtDataField,pioOutput);
InputChanged.Min(0);
InputChanged.Max(2);
ChangedValues:= CreateParam('ValueChanged',PtdataField,pioOutput);
END;
//////////////////////////////////////
// Callback procedure
// inputs have an id (n) from first (top) to n last, the callback proc
// scans the inputs to detect changes,
// and notes the index if detecting one.
// that will allows to launchs different process depending on wich kind of
// inputs changed
Procedure Callback(N:integer);
BEGIN
if n<3
then inputchanged.asInteger(n);
END;
: 