How to store arrays in the object (syntax) Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Ernestas
Posts: 33
Joined: 16 Apr 2018, 02:07

How to store arrays in the object (syntax)  Topic is solved

11 Jan 2020, 13:25

Hello everyone!

I was wondering is there a way to my "Problem":

Code: Select all

!q::

; works fine
arr1 := [1,2,3,4,5]
arr2 := [6,7,8,9,10]
arr3 := [11,12,13,14,15]

dictionary := {"Array1" : arr1 , "Array2" : arr2 , "Array3" : arr3}

for index, element in dictionary.Array1
		msgbox, % element
;------------------------------------------------------------------------------------------------------
; is there a away to shorten this code to be something more like this:

dictionary := {"Array1" : arr1[1,2,3,4,5] , "Array2" : arr2[6,7,8,9,10] , "Array3" : arr3[11,12,13,14,15]}

; I want to have it in one line: to create and to store the information to arrays in the object

for index, element in dictionary.Array1
		msgbox, % element

return 
If anyone has any ideas please be kind to share! It would be interesting to see :)
thank you in advance and have a nice saturday! :)
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: How to store arrays in the object (syntax)

11 Jan 2020, 13:32

Code: Select all

dictionary := {"Array1" : [1,2,3,4,5] , "Array2" : [6,7,8,9,10] , "Array3" : [11,12,13,14,15]}
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], MrHue, Rohwedder, Rxbie, songdg and 375 guests