Page 1 of 1

Replace escaped characters with % syntax

Posted: 06 May 2020, 20:38
by iseahound
Replace Loop Parse, string , `; with Loop Parse, string , % ";"

Re: Replace escaped characters with % syntax

Posted: 07 May 2020, 00:14
by Ragnar
Neither can I find the first string anywhere in the docs, nor do I see the need since both are valid syntax.

Re: Replace escaped characters with % syntax

Posted: 07 May 2020, 12:55
by iseahound
Explain why in Example 4 of the Loop parse page

Code: Select all

Loop, Parse, Colors, `,|;
is a valid construction to an AutoHotkey newbie. Too add to the confusion,

Code: Select all

Loop, Parse, Colors, ;
is not. whereas

Code: Select all

Loop, Parse, Colors, `,`n
is.

Re: Replace escaped characters with % syntax

Posted: 07 May 2020, 14:04
by boiler
iseahound wrote: Explain why in Example 4 of the Loop parse page

Code: Select all

Loop, Parse, Colors, `,|;
is a valid construction to an AutoHotkey newbie.
I would say, "If the comma weren't escaped, it would be the separator between parameters." I think they would get that pretty quickly.
iseahound wrote: Too add to the confusion,

Code: Select all

Loop, Parse, Colors, ;
is not. whereas

Code: Select all

Loop, Parse, Colors, `,`n
is.
These all have good reasons why they are true, as I'm sure you know (space followed by ; indicates a comment, and a comma is a parameter separator).

It sounds like you are not asking for a change to the language itself, so you would prefer that the documentation didn't show escaping characters at all?

Re: Replace escaped characters with % syntax

Posted: 07 May 2020, 14:16
by swagfag
im, too, for revamping the docs to demo only current, best practices

the only argument u can make for keeping the legacy examples around is "theres a lot of legacy code out there".
what can be done is introduce "Expression | Legacy(NOT RECOMMENDED)" tabs to codeboxes hosting revamped examples. that way u get to avoid outright having to delete them

Re: Replace escaped characters with % syntax

Posted: 11 May 2020, 08:27
by nnnik
We could have clickable little boxes that hide the ugly code but people can view if they really see the need to.

Re: Replace escaped characters with % syntax

Posted: 11 May 2020, 12:05
by iseahound
Using % "," is about 5% faster than `, too.