For, % i

Propose new features and changes
SSpeed
Posts: 3
Joined: 04 Jul 2018, 09:48

For, % i

06 Sep 2018, 19:02

I sorta feel like this should exist, what do you think?

Code: Select all

i := 4

For, % i
{
	Msgbox, % i
}
FangLeone
Posts: 12
Joined: 31 Aug 2018, 15:40

Re: For, % i

06 Sep 2018, 19:04

Hmm yeah agreed.
lexikos
Posts: 6207
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: For, % i

06 Sep 2018, 19:22

I have no clue what that is supposed to do.
User avatar
kczx3
Posts: 691
Joined: 06 Oct 2015, 21:39

Re: For, % i

06 Sep 2018, 19:24

Isn’t that just a Loop?
guest3456
Posts: 2464
Joined: 09 Oct 2013, 10:31

Re: For, % i

06 Sep 2018, 19:26

SSpeed wrote:I sorta feel like this should exist, what do you think?

Code: Select all

i := 4

For, % i
{
	Msgbox, % i
}
eh:

Code: Select all

i := 4

Loop, % i
{
	Msgbox, % A_Index
}

SSpeed
Posts: 3
Joined: 04 Jul 2018, 09:48

07 Sep 2018, 10:53

Whatever seems like a good idea.

Code: Select all

i := 4

For, i
{	; i := 1,     i := 2,     i := 3,     i := 4, 
	Msgbox, % i
}

Code: Select all

i := 4
iG := [7,8,9]

For, i in iG
{	; i := 7,     i := 8,     i := 9,
	Msgbox, % i
}
User avatar
kczx3
Posts: 691
Joined: 06 Oct 2015, 21:39

Re: For, % i

07 Sep 2018, 11:18

Based on your first code sample there, it seems like you want a Range like in Python, which others have requested before. I don't see its benefit.

Your second code sample is already a supported feature of the language. I'm not sure why you'd define i before the loop unless its used for something else. The comma after the word "For" can also be omitted.
User avatar
nnnik
Posts: 3526
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: For, % i

07 Sep 2018, 11:25

kczx3 wrote:Based on your first code sample there, it seems like you want a Range like in Python, which others have requested before. I don't see its benefit.

Your second code sample is already a supported feature of the language. I'm not sure why you'd define i before the loop unless its used for something else. The comma after the word "For" can also be omitted.
We could remove all other loops while making things more dynamic with range().
Recommends AHK Studio
User avatar
kczx3
Posts: 691
Joined: 06 Oct 2015, 21:39

Re: For, % i

07 Sep 2018, 11:31

nnnik wrote:We could remove all other loops while making things more dynamic with range().
I do prefer the for k, v in x syntax over the loop syntax, even though its more typing. Suppose that's enough to change my mind about Range().
SSpeed
Posts: 3
Joined: 04 Jul 2018, 09:48

Re: For, % i

07 Sep 2018, 14:39

Could you put a simple example using the For command with an array in the doc? That's all I ask for.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 8 guests