Splitting long lines

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fischerjd
Posts: 2
Joined: 02 Dec 2021, 15:45

Splitting long lines

Post by fischerjd » 02 Dec 2021, 16:14

As an example, I want AutoHotkey to produce this text:

The
quick
brown
fox

After reading the page Splitting a Long Line Into a Series of Shorter Ones and the topic concatinate, I thought the following script would produce the desired output:

Code: Select all

::\test::
SendInput The`n
.quick`n
.brown`n
.fox`n
return
However, when I run this script it produces this output:

The
.quick
.brown
.fox

So what am I misunderstanding regarding using the concatenation operator '.' to split long lines?

User avatar
mikeyww
Posts: 26612
Joined: 09 Sep 2014, 18:38

Re: Splitting long lines

Post by mikeyww » 02 Dec 2021, 16:37

The . is used to concatenate expressions.

Code: Select all

str =
(
a
b
c
)

::\test::
SendInput % "The`n"
 . "quick`n"
 . "brown`n"
 . "fox`n"
 . str
Return

fischerjd
Posts: 2
Joined: 02 Dec 2021, 15:45

Re: Splitting long lines

Post by fischerjd » 02 Dec 2021, 17:08

The . is used to concatenate expressions.
I think I understand now. Thank you.

(Also relevant: changing the parameter mode from legacy mode to expression mode.)

Post Reply

Return to “Ask for Help (v1)”