PDA

View Full Version : Loop



DirectuX
19-06-2020, 14:29
Hi,

I'm wondering


Dim ok as Boolean = %FALSE

Do
ok = %TRUE
loop until ok = %TRUE

msgbox 0, "Passed"
ok = %FALSE

Do
ok = %TRUE
loop until ok

MsgBox 0,"done"

why the second part isn't ending the loop ?

primo
19-06-2020, 15:50
Dangerous code, i run it 3 times and find 3 thinbasic.exe in memory
i have used this BAT file to kill the exe's in windows xp

TASKLIST /FI "IMAGENAME eq thinbasic.exe"
tskill thinbasic
pause

but the code is interesting

DirectuX
19-06-2020, 18:44
Hi Primo, the second loop should exit after the first pass because "ok" as an expression resolves to %TRUE.

You can use the red square of thinAir's toolbar to stop thinBasic's process.

Petr Schreiber
20-06-2020, 15:58
Hi,

thanks a lot for reporting. I think we found the reason, will be fixed in next thinBASIC.


Petr

ErosOlmi
22-06-2020, 20:35
Thanks Petr for fixing it.

Can someone test if now it is working fine?
Attached new thinCore.dll
Please copy it into you \thinBasic\ path and try script.

Thanks
Eros

DirectuX
23-06-2020, 08:02
Can someone test if now it is working fine?
Thanks
Eros

Hello Eros,

the script is working fine now.

Thanks
DirectuX