Jump to content
Sign in to follow this  
crashburn

gui pressing button in loop

Recommended Posts

crashburn

a little help pls.

am making a short script here in gui with buttons, button terminate the looping condition. there are probably 2 loops in 1 function. and another loop in another function, this triggered from the first 2 loops. my question is how to exit loop or interreupt loops when i pressed the designated button?

is this the ryt code for that?

;event occured
$MSG = GUIGetMsg()

if that is, where should i insert that code if the code is like this?

1. if i want to exit "do loop" and i want to go to the main loop

2. or i want to go back to "func 1() while 1 loop" from func 2()

func 1()
;do gui here
;show gui
while 1
                              ;<<<< here?
    if ok <> 1 then
       do
                             ;<<<< here also?
        ...   
       until exitbyuser
   else
        func 2() 
    endif
wend
endfunc

func 2() 
   while 1
                        ;<<<< and here also?
    ...
   wend
endfunc

its working if i insert $MSG = GUIGetMsg() in all of the existing loop, but sometimes it takes time to press or it dosn't exit at all.

is there any other way i can exit loop or 2 loops in one call $MSG = GUIGetMsg()?

Edited by crashburn

Share this post


Link to post
Share on other sites
crashburn

o i get the idea.... why i dindnt think of that.. may be you are ryt. i'll try it now.

hope this work.

tnx.

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.