legacy vs expression mode with msgbox?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
densch
Posts: 120
Joined: 29 May 2018, 15:10

legacy vs expression mode with msgbox?

Post by densch » 05 Aug 2021, 13:30

Hello, I am failing once again at the unique legacy mode vs expression mode stuff that only ahk uses and literally no other programming language.
Namely I tried to use lines like this:

Code: Select all

	MsgBox,,,"CurrColorBet=" . CurrColorBet . "CurrZeroBet" . CurrZeroBet,1
I know for a fact that something like

Code: Select all

variable2:=variable1 . "some stuff"
does work, so i tried to concatenate strings like that in the same way in the msgbox too.
but the msgbox instead of the desired result jsut wrote the text the way it's written down avbove in the code, :-/

how do i have to write this properly in the ahk madness?
ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: legacy vs expression mode with msgbox?

Post by ahk7 » 05 Aug 2021, 13:43

Code: Select all

MsgBox,,, % "CurrColorBet=" . CurrColorBet . "CurrZeroBet" . CurrZeroBet,1
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: legacy vs expression mode with msgbox?

Post by guest3456 » 05 Aug 2021, 13:46

densch wrote:
05 Aug 2021, 13:30
how do i have to write this properly in the ahk madness?
as shown in the post above, you simply prefix the literal text legacy param with a %

see here:
https://www.autohotkey.com/docs/Variables.htm#percent-space

ahk v2 removes this madness, eliminates all legacy literal text params

Post Reply

Return to “Ask for Help (v1)”