Results 1 to 6 of 6

Thread: Loop

  1. #1

    Question Loop

    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 ?
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #2
    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

  3. #3
    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.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    Hi,

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


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10
    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
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  6. #6

    Thumbs up

    Quote Originally Posted by ErosOlmi View Post
    Can someone test if now it is working fine?
    Thanks
    Eros
    Hello Eros,

    the script is working fine now.

    Thanks
    DirectuX
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

Similar Threads

  1. evaluation once or every loop
    By primo in forum thinBasic General
    Replies: 9
    Last Post: 18-02-2017, 18:40
  2. Problems with Arrays In For/Next Loop
    By peralta_mike in forum Core module
    Replies: 4
    Last Post: 17-05-2011, 15:53
  3. Repeat or loop
    By Henry in forum thinBasic General
    Replies: 1
    Last Post: 30-11-2007, 14:24
  4. Usage of DO/LOOP, DO WHILE/LOOP, DO / LOOP UNTIL
    By Petr Schreiber in forum Samples for help file
    Replies: 2
    Last Post: 29-05-2007, 16:06

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •