Loop Parse, - What happens?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Albireo
Posts: 1752
Joined: 16 Oct 2013, 13:53

Loop Parse, - What happens?

21 Jul 2017, 04:44

I hope I can explain my thought :)

Loop Parse, ListBox, `n is a great command, But what happens if I change the conditions?
like this .:

Code: Select all

Loop Parse, ListBox, `n
{	...
	Make some commands that affect the contents of "Listbox"
	...
	; Analyse the new "Listbox" 
	Loop Parse, Listbox, `n
	{
		...
	}
	...
}
Will the main loop be affected by changing the conditions in that loop?
(Or are the first conditions for the main loop as apply?)

If the new conditions are analyzed with Loop Parse, ListBox, `n in a inner loop, will there be any problems with that?
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Loop Parse, - What happens?

21 Jul 2017, 05:02

Did you try?
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
Albireo
Posts: 1752
Joined: 16 Oct 2013, 13:53

Re: Loop Parse, - What happens?

21 Jul 2017, 06:59

No!
But I'm unsure it works! (And how to test)
Maybe the safest way, is to save the different lists, and work from the result, instead of the real lists?
User avatar
AlphaBravo
Posts: 586
Joined: 29 Sep 2013, 22:59

Re: Loop Parse, - What happens?

21 Jul 2017, 09:23

Albireo wrote:No!
But I'm unsure it works! (And how to test)
Maybe the safest way, is to save the different lists, and work from the result, instead of the real lists?

Code: Select all

listBox =
(
one
two
)

Loop Parse, ListBox, `n, `r
{
	MsgBox, 262144, Outer Loop, % A_LoopField
	StringUpper, ListBox, ListBox
	ListBox .= "`n" A_Index
	
	Loop Parse, Listbox, `n, `r
	{
		MsgBox, 262144, Inner Loop, % A_LoopField
	}
}
return
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Loop Parse, - What happens?

21 Jul 2017, 18:33

Loop, Parse wrote:In addition, if InputVar's contents change during the execution of the loop, the loop will not "see" the changes because it is operating on a temporary copy of the original contents.
Does that answer your question?
Albireo
Posts: 1752
Joined: 16 Oct 2013, 13:53

Re: Loop Parse, - What happens?

24 Jul 2017, 01:19

Yes!
It worked as I hoped it would do.
Thank You!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 210 guests