Bug with continuation section [a122]

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
Tigerlily
Posts: 377
Joined: 04 Oct 2018, 22:31

Bug with continuation section [a122]

Post by Tigerlily » 11 Apr 2021, 04:07

[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)
-TL

xroot
Posts: 40
Joined: 21 Jun 2019, 08:45

Re: Bug with continuation section [a122]

Post by xroot » 11 Apr 2021, 10:11

Use the Format function.
Like:

Code: Select all

pasta := "[found]"

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

msgbox str

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Bug with continuation section [a122]

Post by lexikos » 11 Apr 2021, 16:58

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.

SandyClams
Posts: 63
Joined: 02 Jul 2020, 11:55

Re: Bug with continuation section [a122]

Post by SandyClams » 11 Apr 2021, 20:29

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!

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Bug with continuation section [a122]

Post by lexikos » 11 Apr 2021, 22:25

I use a program called AutoHotkey - it can automate stuff like this.

SandyClams
Posts: 63
Joined: 02 Jul 2020, 11:55

Re: Bug with continuation section [a122]

Post by SandyClams » 11 Apr 2021, 23:17

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.

Post Reply

Return to “Ask for Help (v2)”