Best way to output an array to inspect contents

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
omar
Posts: 545
Joined: 22 Oct 2015, 17:56

Best way to output an array to inspect contents

Post by omar » 03 Oct 2023, 17:27

I'm writing some code to read in a CSV or copy data from the Clipboard.
I'll be storing in a 2 dimensional array

Is there quick way of inspecting the array?
I can't just print the array?

I need something quick so I can inspect the contents of arrays

When I googled I found the best solution was to make strings and output in msgbox.

Surely there has to be a better way?
Why is there not a built in method where you can just: print array?

Thanks
User avatar
andymbody
Posts: 996
Joined: 02 Jul 2017, 23:47

Re: Best way to output an array to inspect contents

Post by andymbody » 03 Oct 2023, 18:01

omar wrote:
03 Oct 2023, 17:27
Surely there has to be a better way?
Why is there not a built in method where you can just: print array?
I don't know of a builtin "print array" command/feature. I personally created an ArrayToStr() function in my CommonFunc.ahk (in my library) for this. I can specify the preferred deliminator with each call. That way I can just call the function to view the contents easily, without having to write the code each time I need it.

If you don't fancy the string idea, which format do you envision the output being in?
User avatar
Chunjee
Posts: 1501
Joined: 18 Apr 2014, 19:05
Contact:

Re: Best way to output an array to inspect contents

Post by Chunjee » 03 Oct 2023, 19:23

biga.ahk has .print which sends directly to standard output device like Visual Studio Code uses
RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Best way to output an array to inspect contents

Post by RussF » 04 Oct 2023, 06:19

So far, everything you have described can be done very easily by just loading the CSV into Excel, LibreCalc or Google sheets. You have not described anything (yet) that would require an AHK script.

Russ
Post Reply

Return to “Ask for Help (v1)”