[a121] Loop Parse string issue. Topic is solved

Report problems with documented functionality
User avatar
aseiot
Posts: 79
Joined: 05 Mar 2017, 04:25

[a121] Loop Parse string issue.

12 Aug 2020, 19:32

Code: Select all

X := "* TEST"

MsgBox TestFunc(X)											; report messy word


TestFunc(text)
{
	out := ""
	Loop Parse, text, "`n", "`r"
	{
		t:= A_LoopField
		out .= f()
	}
	
	return out
	
	f(){
		return out .= "<>" t
	}
}
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: [a121] Loop Parse string issue.

12 Aug 2020, 20:55

Not at my computer but won’t this append to out twice per loop iteration?
User avatar
aseiot
Posts: 79
Joined: 05 Mar 2017, 04:25

Re: [a121] Loop Parse string issue.

12 Aug 2020, 23:38

kczx3 wrote:
12 Aug 2020, 20:55
Not at my computer but won’t this append to out twice per loop iteration?
Not happened every time. You can try to run it several times. This is just one of what I see.
2020-08-13_123720.png
2020-08-13_123720.png (2.33 KiB) Viewed 1794 times
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: [a121] Loop Parse string issue.

13 Aug 2020, 00:08

doesnt seem to be related to loop parse in particular but rather references to upvars

Code: Select all

MsgBox f() ; garbage

f() {
	s := '15 chars + null'

	g() {
		s .= ''
	}

	MsgBox s ; '15 chars + null'
	return s
}

fixed in a recent commit
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: [a121] Loop Parse string issue.  Topic is solved

28 Feb 2021, 00:06

Fixed in (I think) v2.0-a122.

Return to “Bug Reports”

Who is online

Users browsing this forum: vikasgandhi and 21 guests