best way to escape  := ('‎‎   ? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
xMaxrayx
Posts: 214
Joined: 06 Dec 2022, 02:56
Contact:

best way to escape  := ('‎‎   ?

15 May 2024, 04:07

Hi what is best way to escape (' and what this combo called?

('
(
)'
)


why they looks wired and why the next one not accepted?

('
(
)
')



Code: Select all

    Script := ('
    (
    SoundPlay('" path "' ,1) 
    Msgbox("Hi again")
    Msgbox("and again Hi")
    )')
I want insert path as variable (in first line) what best way to approach?
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/
User avatar
Seven0528
Posts: 395
Joined: 23 Jan 2023, 04:52
Location: South Korea
Contact:

Re: best way to escape := (' ?  Topic is solved

15 May 2024, 04:21

 Because the outermost parentheses of the code are unnecessary in this case (as the expression or operation order is not a concern),
and the syntax for specifying multi-line strings is precisely agreed upon as follows.
Please refer to the document titled Splitting a Long Line into a Series of Shorter Ones for more detailed information.

Code: Select all

#Requires AutoHotkey v2.0
#SingleInstance Force

script := '
(
soundPlay('" path "' ,1) 
msgbox("Hi again")
msgbox("and again Hi")
)'
msgbox(A_Clipboard := script)

Continuation section: This method should be used to merge a large number of lines or when the lines are not suitable for the other methods. Although this method is especially useful for auto-replace hotstrings, it can also be used with any expression. For example:

Code: Select all

; EXAMPLE #1:
Var := "
(
A line of text.
By default, the hard carriage return (Enter) between the previous line and this one will be stored.
	This line is indented with a tab; by default, that tab will also be stored.
Additionally, "quote marks" are automatically escaped when appropriate.
)"

; EXAMPLE #2:
FileAppend "
(
Line 1 of the text.
Line 2 of the text. By default, a linefeed (`n) is present between lines.
)", A_Desktop "\My File.txt"
  • English is not my native language. Please forgive any awkward expressions.
  • 영어는 제 모국어가 아닙니다. 어색한 표현이 있어도 양해해 주세요.
User avatar
Seven0528
Posts: 395
Joined: 23 Jan 2023, 04:52
Location: South Korea
Contact:

Re: best way to escape  := ('‎‎   ?

15 May 2024, 04:29

Code: Select all

var := '
(Join_
セ
ブ
ン
)'

Code: Select all

var := 
(
'セ'
'_ブ'
'_ン'
)

Code: Select all

var := ''
. 'セ'
. '_ブ'
. '_ン'
セ_ブ_ン

Code: Select all

var := '
(
(
`)
)'
(
)
  • English is not my native language. Please forgive any awkward expressions.
  • 영어는 제 모국어가 아닙니다. 어색한 표현이 있어도 양해해 주세요.
User avatar
xMaxrayx
Posts: 214
Joined: 06 Dec 2022, 02:56
Contact:

Re: best way to escape  := ('‎‎   ?

15 May 2024, 05:03

@Seven0528

I see many thanks for your example <3
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Draken, niCode, Rohwedder, songdg and 22 guests