1.1.29.00 Display Issue

Report problems with documented functionality
User avatar
TLM
Posts: 1338
Joined: 01 Oct 2013, 07:52

1.1.29.00 Display Issue

25 May 2018, 15:56

Latest version does not display inline values correctly

Code: Select all

MsgBox % ">>" ["A", "B", "C"].Count() "<<"
MsgBox % ">>" ["A", "B", "C"].Length() "<<"
Both display << only..
Isolated works

Code: Select all

MsgBox % ">>" ( ["A", "B", "C"].Count() ) "<<"
swagfag
Posts: 1381
Joined: 11 Jan 2017, 17:59

Re: 1.1.29.00 Display Issue

25 May 2018, 16:25

i dont think this has much to do with the update in and of itself.
here's something on 1.1.28.02:

Code: Select all

; MsgBox % ">>" ["A", "B", "C"].Count() "<<" ; not available in 1.1.28.02

MsgBox % ">>" ["A", "B", "C"].Length() "<<" ; doesnt work, returns: <<

arr := ["A", "B", "C"]
MsgBox % ">>" arr.Length() "<<" ; works, returns: >>3<<

MsgBox % ["A", "B", "C"].Length() ; expression, works, returns: 3

MsgBox % ">>" . ["A", "B", "C"].Length() . "<<" ; explicit concat, works, returns: >>3<<
MsgBox % ">>" (["A", "B", "C"].Length()) "<<" ; forced expression/implicit concat, works, returns: >>3<<
Helgef
Posts: 3238
Joined: 17 Jul 2016, 01:02
Contact:

Re: 1.1.29.00 Display Issue

25 May 2018, 16:32

This is documented behaviour.
[v1.0.97+]: Array literal. If the open-bracket is not preceded by a value (or a sub-expression which yields a value), it is interpreted as the beginning of an array literal. For example, [a, b, c] is equivalent to Array(a, b, c)
Hence, if it is, it isn't. (That is ["A","B","C"] tries to do member access on ">>" which isn't valid)
Spoiler
Cheers.
swagfag
Posts: 1381
Joined: 11 Jan 2017, 17:59

Re: 1.1.29.00 Display Issue

25 May 2018, 17:03

.. tries to do member access on ">>" which isn't valid..
how so?

Code: Select all

; https://autohotkey.com/docs/Variables.htm#operators
; https://autohotkey.com/boards/viewtopic.php?f=14&t=49605
; 1.1.28.02 btw if that makes any difference

Arr := {"A": {"B": {"C": "kek"}}}
MsgBox, % "Arr" ["A", "B", "C"] ; supposed member access, returns: blank
MsgBox, % Arr["A", "B", "C"] ; actual member access, returns: kek

; >> := {"A": {"B": {"C": "kek"}}} ; moot, cant declare var '>>'
; MsgBox, % ">>" ["A", "B", "C"] ; moot, cant declare var '>>'
; MsgBox, % >>["A", "B", "C"] ; moot, cant declare var '>>'
Helgef
Posts: 3238
Joined: 17 Jul 2016, 01:02
Contact:

Re: 1.1.29.00 Display Issue

25 May 2018, 17:13

As I said, it is invalid, because you cannot member access a string.
Spoiler
Cheers.
swagfag
Posts: 1381
Joined: 11 Jan 2017, 17:59

Re: 1.1.29.00 Display Issue

25 May 2018, 17:33

i see
Spoiler
User avatar
jeeswg
Posts: 5287
Joined: 19 Dec 2016, 01:58
Location: UK

Re: 1.1.29.00 Display Issue

25 May 2018, 17:41

- Here's the issue, you can put a space between the object name and the first square bracket.
- If you use a literal string for the object name, it refers to the base object for strings.

Code: Select all

q:: ;get value from object/string
"".base.__get := "f"
Arr := {"A": {"B": {"C": "hey"}}}
MsgBox, % "Arr" ["A", "B", "C"] ;HEY ;surprising
MsgBox, % Arr ["A", "B", "C"] ;hey ;surprising
MsgBox, % "Arr"["A", "B", "C"] ;HEY ;surprising
MsgBox, % Arr["A", "B", "C"] ;hey
return

f()
{
	return "HEY"
}
- I had this issue before, but I've only now fully understood it. (Thanks Helgef.)
possible issue with GetCapacity? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 10#p153010
lexikos
Posts: 6205
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: 1.1.29.00 Display Issue

25 May 2018, 21:59

As I said, it is invalid, because you cannot member access a string.
It is invalid because strings have no members by default. As you showed, it can be valid.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 4 guests