## MultiDIM Array Quirks

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

user5274
Junior Coder
Posts: 36
Joined: Tue Aug 04, 2020 9:35 am

### MultiDIM Array Quirks

Hi again some time back I came across these quirks and hopefully can get a workaround or solution. The first is reDim'ing multidimensional arrays, the following code creates 2 separate arrays THISARRAY_2 and THISARRAY_%WW%, of course the second array is unexpected.

Code: Select all

``````Let>WW=2

//make array with 8 elements
ArrayDim>THISARRAY_%WW%,8,integer

//now make it with 11 elements
ArrayDim>THISARRAY_%WW%,11,integer

**BREAKPOINT**
Exit>``````
Now the above lead to the second quirk, thinking I could delete the array and start from scratch.

Code: Select all

``````Let>WW=2
ArrayDim>THISARRAY_%WW%,8,integer

DelArray>THISARRAY_%WW%
//array has not been deleted
Assigned>THISARRAY_2_8,TMP
MDL>Assigned=%TMP%

DelArray>THISARRAY_2
//array has been deleted
Assigned>THISARRAY_2_8,TMP
MDL>Assigned=%TMP%

**BREAKPOINT**
Exit>``````
DelArray cannot delete THISARRAY_%WW%

user5274
Junior Coder
Posts: 36
Joined: Tue Aug 04, 2020 9:35 am

### Re: MultiDIM Array Quirks

One more quirk, BUT i found a workaround to

Code: Select all

``````Let>WW=2
Let>QINDX=55,66,77,88,99,11
Separate>QINDX,COMMA,THISARRAY_%WW%,integer
``````
This creates an array THISARRAY_%WW% instead of THISARRAY_2, but the workaround below works

Code: Select all

``````Let>WW=2
Let>QINDX=55,66,77,88,99,11
Separate>QINDX,COMMA,TMPARRAY,integer
ArrayCopy>TMPARRAY,,THISARRAY_%WW%
DelArray>TMPARRAY
``````

Grovkillen
Automation Wizard
Posts: 695
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

### Re: MultiDIM Array Quirks

Tried this?

Code: Select all

``````Let>WW=2
Let>QINDX=55,66,77,88,99,11
Separate>QINDX,COMMA,{THISARRAY_%WW%},integer
``````
Let>ME=%Script%

Running: 15.0.19b
version history

user5274
Junior Coder
Posts: 36
Joined: Tue Aug 04, 2020 9:35 am

### Re: MultiDIM Array Quirks

Just did it made these vars

Code: Select all

``````0: {THISARRAY_%WW%}_1=55
0: {THISARRAY_%WW%}_2=66
0: {THISARRAY_%WW%}_3=77
0: {THISARRAY_%WW%}_4=88
0: {THISARRAY_%WW%}_5=99
0: {THISARRAY_%WW%}_6=11
0: {THISARRAY_%WW%}_COUNT=6``````

Grovkillen
Automation Wizard
Posts: 695
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

### Re: MultiDIM Array Quirks

Code: Select all

``````Let>WW=2
Let>QINDX=55,66,77,88,99,11
Separate>QINDX,COMMA,{"THISARRAY_%WW%"},integer
``````
Same thing using this?
Let>ME=%Script%

Running: 15.0.19b
version history

user5274
Junior Coder
Posts: 36
Joined: Tue Aug 04, 2020 9:35 am

### Re: MultiDIM Array Quirks

Same, creates {"THISARRAY_%WW%"} array

Just so this thread does not get lost in it main purpose I will re-list the quirks:

Code: Select all

``````ArrayDim>THISARRAY_%WW%,8,integer
ArrayDim>THISARRAY_%WW%,11,integer``````
Re-dim'ing a multi-dim array creates an unexpected array

Code: Select all

``DelArray>THISARRAY_%WW%``
Cannot delete a multi-dim array

Code: Select all

``Separate>QINDX,COMMA,THISARRAY_%WW%,integer``
Cannot separate into a multi-dim array

See previous posts for full examples

user5274
Junior Coder
Posts: 36
Joined: Tue Aug 04, 2020 9:35 am

### Re: MultiDIM Array Quirks

Could I get confirmation that these quirks are intended and I can continue to find workarounds on my own. Thank you.

Marcus Tettmar