Nivekk / KOS

Fully programmable autopilot mod for KSP.
Other
80 stars 30 forks source link

UNTIL will break at first chance. #278

Open a1270 opened 10 years ago

a1270 commented 10 years ago

If the UNTIL condition ever becomes true the loop will break even if not completely executed.

 SET a TO 5.
 UNTIL a<0.5 {
   PRINT a.
   SET b TO a - 1.
   SET a TO 0.
   SET a TO b - 1.
 }.
 PRINT "Done: " + a.
5
Done: 0

Can't figure out a good way to find out where in the block we're at.

adammada commented 10 years ago

can you point which part of code does that? I really dont like that error codes don't show correct line number and that is probably the same part of code.

a1270 commented 10 years ago

@adammada https://github.com/Nivekk/KOS/blob/master/CommandFlowControl.cs line 164 is where the check happens.

weissel commented 10 years ago

@a1270 Which version of KOS is that? Can't reproduce on v0.9.2.

a1270 commented 10 years ago

@weissel seems it was a typo. Totally didn't see it the many times i looked at the code.