Page 1 of 1

Bug with continuation section [a122]

Posted: 11 Apr 2021, 04:07
by Tigerlily
[Moderator's note: Topic moved from AutoHotkey v2 Development.]

Image

IDK how to get rid of the `. I get a bunch of errors any other way that I try and make the pasta variable

Image

My crude workaround ^ (not good lol)

Re: Bug with continuation section [a122]

Posted: 11 Apr 2021, 10:11
by xroot
Use the Format function.
Like:

Code: Select all

pasta := "[found]"

str := format("
(
    {}
    a string
    " pasta "
    ' pasta '
)",pasta)

msgbox str

Re: Bug with continuation section [a122]

Posted: 11 Apr 2021, 16:58
by lexikos
Firstly, bugs should be reported in the Bug Reports forum.

Secondly, a122 is quite outdated. Please consider testing in a newer version before posting bug reports.

Thirdly, Ask for Help v2 is a better fit for this topic. It has the tone of "my script has a problem and I need help fixing it".


"automatically escaped" is meant quite literally:
Quote marks are automatically escaped (i.e. they are interpreted as literal characters) if the continuation section starts inside a quoted string
Source: Scripts - Definition & Usage | AutoHotkey v2
If you really want to end quotes inside a continuation section, start them only inside the continuation section (and then you must escape any literal quotes, consistently).

Code: Select all

pasta := "[found]"

str :=
(
    pasta "
    a string
    `" pasta `"
    ' pasta '
)"

msgbox str
But it's usually better to use Format, IMO.

Re: Bug with continuation section [a122]

Posted: 11 Apr 2021, 20:29
by SandyClams
dang @lexikos, that citation linking the docs page underneath your quote, did you bake that formatting into your forum code somehow, or are you doing that manually? I quoted your post so I could examine it, and it looks manual.... but why!

Re: Bug with continuation section [a122]

Posted: 11 Apr 2021, 22:25
by lexikos
I use a program called AutoHotkey - it can automate stuff like this.

Re: Bug with continuation section [a122]

Posted: 11 Apr 2021, 23:17
by SandyClams
I had a feeling it was some automated thing on your pc. I don't know why it struck me as worth mentioning. I just know I've spent a lot of time baking my own QOL things into my own forum software in the past and it jumped out at me right away.