Ok, having an issue withe the return value of a function always returning "undefined"
Heres my code:
//called here:
var res = comms(GENSET_SN);
//the function
function comms(genserial) {
var Result;
//Webservice called here
MyServices.getCommsState(genserial, "S1", OnComplete1);
function OnComplete1(args) {
var Res = eval("(" + args + ")");
if (Res == 1) {
Result = 1;
} else {
Result = 0;
}
}
return Result;
}
please help!!