I have searched the KB and can not seem to find an answer to the following question.
I am using Function Paramaters in one of my existing studies. The study has a Function Main() section, then under that section, there is a Function on Action1() section. When I try to put a paramater from the Function Paramaters in the Function on Action1() section, it does not appear to work.
My questions is, does a paramater from Function Paramaters have to be within the Function Main() section?
In the code below, what I am trying to accomplish is to play a sound only if the paramater Sound is = to 1.
Any help would be greatly appreciated.
Regards,
ZMendel
I am using Function Paramaters in one of my existing studies. The study has a Function Main() section, then under that section, there is a Function on Action1() section. When I try to put a paramater from the Function Paramaters in the Function on Action1() section, it does not appear to work.
My questions is, does a paramater from Function Paramaters have to be within the Function Main() section?
In the code below, what I am trying to accomplish is to play a sound only if the paramater Sound is = to 1.
PHP Code:
function preMain() {
var fp1 = new FunctionParameter("ADXr", FunctionParameter.NUMBER);
fp1.setLowerLimit(0);
fp1.setDefault (3);
var fp2 = new FunctionParameter("Sound", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fpt.setUpperLimit(1)
fp2.setDefault (0);
}
function main(ADXr) {
var vADXDM = new ADXDMStudy(ADXr);
if (
vADXDM.getValue(ADXDMStudy.PDI) > vADXDM.getValue(ADXDMStudy.NDI)
) onAction1()
else if (
vADXDM.getValue(ADXDMStudy.PDI) < vADXDM.getValue(ADXDMStudy.NDI)
) onAction2();
return new Array(
vADXDM.getValue(ADXDMStudy.PDI),
vADXDM.getValue(ADXDMStudy.NDI)
);
}
function onAction1(Sound) {
setBarBgColor(Color.RGB(192,255,160));
if (vLastAlert != 1 & Sound = 1) Alert.playSound ("C:\\ProgramFiles\\eSignal Pro\\Sounds\\Ding.wav");
vLastAlert = 1;
}
Regards,
ZMendel
Comment