Who can help me out with the following problem. Here is a simplified version of my code.
//global
var s
function preMain() {
...
}
function main() {
...
if (condition w) {
debugPrintln("test 1")}
...
if (condition x) {...}
else {s=fSample();
debugPrintln("test 2" + s)}
}
...
return ...;
}
function fSample() {
var i=-1;
if (condition y) {
i=1;
while (condition z) {...}
...
}
return i;
}
I discovered in the formula output window, that in the case of failing condition y, function fSample is called for twice, right after each other (1 time too much!--> error 1). If condition y is met, s is given the value i, but the debugPrintln("test 2" +s) is never called for. The program seems to jump right to debugPrintln("test 1") again (--> error 2). And that without any loops, which could cause this, being present!
Could someone please explain me what's happening here?
Bart
//global
var s
function preMain() {
...
}
function main() {
...
if (condition w) {
debugPrintln("test 1")}
...
if (condition x) {...}
else {s=fSample();
debugPrintln("test 2" + s)}
}
...
return ...;
}
function fSample() {
var i=-1;
if (condition y) {
i=1;
while (condition z) {...}
...
}
return i;
}
I discovered in the formula output window, that in the case of failing condition y, function fSample is called for twice, right after each other (1 time too much!--> error 1). If condition y is met, s is given the value i, but the debugPrintln("test 2" +s) is never called for. The program seems to jump right to debugPrintln("test 1") again (--> error 2). And that without any loops, which could cause this, being present!
Could someone please explain me what's happening here?
Bart
Comment