Jump to content
Sign in to follow this  
ajit

Loop problem

Recommended Posts

ajit

Hi

I have a do... Until loop inside a While loop. When Do Until loop is in progress (Case $Count) the GUI is nonresponsive. Is it possible to recieve GUI messages such as $GUI_EVENT_CLOSE when Do..Until loop is in progress.

Please help me.

Thanking in anticipation.

Ajit

;;;;;;;;;;;code;;;;;;;;;;;;

$i=1

While 1

Switch GUIGetMsg()

Case $GUI_EVENT_CLOSE

Exit

Case $Count

Do

MsgBox(0, "Value of $i is:", $i)

$i = $i + 1

Until $i = 100

EndSwitch

WEnd

Share this post


Link to post
Share on other sites
Valuater

Maybe,,,

Local $i = 1, $Looper

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Count
            $Looper = 1

    EndSwitch

    If $Looper Then
        MsgBox(0, "Value of $i is:", $i)
        $i = $i + 1
        If $i >= 100 Then
            $i = 1
            $Looper = 0
        EndIf
    EndIf

WEnd

... Otherwise, you can set to OnEventMode()

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
zorphnog

Not sure exactly what you are trying to accomplish here, but you would still need to be receiving gui messages in order to catch a close event. Of course doing it this way you will lose any messages other than $GUI_EVENT_CLOSE that might be sent. If you post your full code, we may be able to suggest a better way to accomplish this.

$i=1

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Count
            Do
                If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
                MsgBox(0, "Value of $i is:", $i)
                $i = $i + 1
            Until $i = 100
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
ajit

@Valuator

Thanks very much for the reply. I am trying it out.

Regards

Ajit

Share this post


Link to post
Share on other sites
ajit

@zorphnog

Thanks for the reply.

Did not post the code as it was a complete mess. Will post it as soon as i clean it.

Thanks again.

Regards

Ajit

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.