AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help with stop loop and new gui!!!!!!!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
myscript



Joined: 05 Jul 2007
Posts: 14

PostPosted: Thu Jul 05, 2007 6:23 pm    Post subject: help with stop loop and new gui!!!!!!! Reply with quote

hi, all
i have a problem like this:

Code:
loop, 6
{
element:= myarray%A_index%
make_gui2(element)  ;----->the loop don't wait user imput
}


For each element in gui, 2 i must insert the parameter element but the loop don't stop

Anyone can tell me how i can do ????

Thanks all!!!!!!!
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Thu Jul 05, 2007 7:46 pm    Post subject: Reply with quote

please show us this function:
make_gui2()
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
myscript



Joined: 05 Jul 2007
Posts: 14

PostPosted: Fri Jul 06, 2007 9:33 am    Post subject: show make_gui2() Reply with quote

here is the function....thanks

Code:
make_gui2(byref element){

;for each element i'd like to have three possible choices and insert one of them in a file text
Gui, 2:+owner1
Gui, 2: Add, CheckBox, x26, y37 w830 h110 gone vone, %element% - first choices
Gui, 2: Add, CheckBox, x26, y157 w830 h110 gtwo vtwo, %element% - second choices
Gui, 2: Add, CheckBox, x26, y287 w830 h110 gthree vthree, %element% - third choices
Gui, 2: Show, Center h443, w881 TITLE %element%






}
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Jul 06, 2007 5:03 pm    Post subject: Reply with quote

no lines in that code are lines that wait for user input. I think you should try going about your problem in a different way. As a user, I would be annoyed by 6 different GUIs popping up as I make each choice.

Also, all your GUI lines have an extra comma between the x and y parameter, the need to have only a space or tab between them.

Lastly, since you have G labels on everything, Maybe you want to use radio buttons instead of checkboxes?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
myscript



Joined: 05 Jul 2007
Posts: 14

PostPosted: Fri Jul 06, 2007 7:25 pm    Post subject: Reply with quote

Probably i have faced the problem in mistaken way, you have reason
The extra comma was a mistake....

Really aren't 6 gui because the number of element in the array that aren't empty is between 1 to 4, but....
Code:



loop, 6
{
element:= myarray%A_index%
if element{ ;element must be <> empty
make_gui2(element)  ;----->the loop don't wait user imput
}
}

make_gui2(byref element){
Gui, 2:+owner1
Gui, 2: Add, CheckBox, x26 y37 w830 h110 gone vone, %element% - first choices
Gui, 2: Add, CheckBox, x26 y157 w830 h110 gtwo vtwo, %element% - second choices
Gui, 2: Add, CheckBox, x26 y287 w830 h110 gthree vthree, %element% - third choices 
Gui, 2: Show, Center h443, w881 TITLE %element%
}



My poblem is:
for each element (that can be between 1 to 4 but i don't know the number before) i have three choise

i.e. element1 ----->choice 1
element2 ----->choice 2
element3 ----->choice 2
element4 ----->choice 3

Probably i must write the element on a temp file, then read the line one at a time and display the gui for each line...........?
I would have expected that the loop stop itself when gui, 2:Show to wait my choice........
thanks for the time that you have dedicated to me...sorry for my poor english that dont'allow me to explain the real question...thanks
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Jul 06, 2007 7:49 pm    Post subject: Reply with quote

gui, show does not stop the script. Where in the documentation did you read that?

Typically, a Gui script has a SINGLE Gui, Show, followed by a return.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
ManaUser



Joined: 24 May 2007
Posts: 901

PostPosted: Fri Jul 06, 2007 8:02 pm    Post subject: Reply with quote

Well, if you want the Gui to pause the script, you could use WinWaitClose with the Gui's title. Another option is to use a MsgBox, and customize the buttons as in this example.
Back to top
View user's profile Send private message
myscript



Joined: 05 Jul 2007
Posts: 14

PostPosted: Fri Jul 06, 2007 8:19 pm    Post subject: Reply with quote

thanks,
it's what i'm looking for....... : Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group