Is concatenation of integers as strings intended? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
iseahound
Posts: 1472
Joined: 13 Aug 2016, 21:04
Contact:

Is concatenation of integers as strings intended?

27 Jan 2024, 22:34

Such as

Code: Select all

MsgBox 12 34
returning "1234"?

I'm wondering if this behavior can be relied on in the future.
User avatar
boiler
Posts: 17399
Joined: 21 Dec 2014, 02:44

Re: Is concatenation of integers as strings intended?  Topic is solved

27 Jan 2024, 22:49

They are both expressions, and the result of each expression is concatenated into a string (as opposed to both being treated as strings and then concatenated) as demonstrated below, which can be counted on.

Code: Select all

#Requires AutoHotkey v2.0
MsgBox 012 034  ; result is 1234
MsgBox 0xC 0x22 ; result is 1234
iseahound
Posts: 1472
Joined: 13 Aug 2016, 21:04
Contact:

Re: Is concatenation of integers as strings intended?

27 Jan 2024, 23:00

Okay, that second line is very interesting behavior. Thanks!

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: macromint, wilkster and 84 guests