Representing a one- or two-dimensional indexed array as a table

Post your working scripts, libraries and tools for AHK v1.1 and older
lyubarsky
Posts: 8
Joined: 01 Mar 2023, 13:09

Representing a one- or two-dimensional indexed array as a table

Post by lyubarsky » 15 Mar 2023, 17:53

I want to offer a debug function _ArrayView("Array"), which accepts a string with the name of a one-dimensional or two-dimensional index array and creates a table corresponding to this array. This way of passing an array using a string containing its name is connected
only with the desire to put this name in the header of the table.
Array indexing does not necessarily start from 1, but can be any, even negative, and also have gaps. The array element with indices (i, j) is placed in the table in row i and column j.
Table columns have a minimum width in order to display their contents. But table elements that are longer than MaxColumnWidth are cut off and end with an ellipsis.
If the table does not fit in the window, then it can be moved using the Up, Down, Left, Right, Left+Up, Right+Down arrows. The Numpad0 key returns the table to its original (before moving) state.
It is convenient to set a hot key, according to which the _ArrayView("Array") function call is inserted into the tested program.
Spoiler
Test array:
Spoiler
Download: https://www.dropbox.com/s/4wjn879mbroo3i2/_ArrayView-en.zip?dl=0


[Mod edit: Moved topic to AHK v1 'Scripts and Functions', due to used syntax. Fixed second code box.]

Return to “Scripts and Functions (v1)”