You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just tested and confirmed the problem.
Interestingly it's ONLY a problem with the FOR loop. The UNTIL loop works fine.
This was my test case:
testprog1.ks:
// dumb program to try calling another program in a loop.
SET things TO LIST().
things:ADD("AAA").
things:ADD("BBB").
things:ADD("CCC").
FOR thing IN things {
RUN testprog2( thing ).
}.
testprog2.ks:
// dumb test program that just prints whatever you pass it in.
declare parameter printThis.
print printThis.
It just runs with no output at all.
If you change the loop in testprog1 from thsi:
FOR thing IN things {
RUN testprog2( thing ).
}
to this instead:
SET i TO 0.
UNTIL i >= things:LENGTH() {
RUN testprog2( things[i] ).
SET i TO i +1.
}
Hello,
writing first bug so excuse if didn't put enough information or asked stupid questions.
I have 2 scripts:
prog.ks:
SET L TO LIST().
L:ADD(1).
L:ADD(2).
FOR E IN L {
RUN subprog(E).
}
and subprog.ks:
DECLARE PARAMETER ListElement.
PRINT "subprog run with: " + ListElement.
KoS ignores command RUN in FOR loop in prog.ks.
When I "improve" prog.ks following way:
SET L TO LIST().
L:ADD(1).
L:ADD(2).
RUN subprog("dummy"). //this line is added to overcome the problem.
FOR E IN L {
RUN subprog(E).
}
Then subprog is run from all places correclty.
Could you please suggest whether it is a bug or I'm using RUN command in a wrong way? Thanks in advance.
//mrantmet
The text was updated successfully, but these errors were encountered: