Possibility to do Multi-Dimensional Arrays?



  • Hi,

    Is there a way to create a Two or more dimensional Arrays?
    Example:
    var test = Array;
    test[1][param1] = value1_1;
    test[1][param2] = value1_2;
    test[1][param3] = value1_3;
    test[2][param1] = value2_1;
    test[2][param2] = value2_2;
    test[2][param3] = value2_3;

    Is there a workaround using an Object instead?



  • @Alex-Paradis I just used a 2D array yesterday. No problems here



  • @dustbro
    How did you wrote it?

    Here's my code:

    var previousButtons = Array;
    previousButtons['11']['1'] = "F";
    

    Everytime I get this error :
    Main Script:! Line 80, column 23: Cannot assign to this expression! {TWFpbiBTY3JpcHR8fDIyODl8ODB8MjM=}



  • @Alex-Paradis

    HiseSnippet 734.3ocsU01SaCCD1tzLs1sNMj1Ofn9ohTGjTdYSBMMf9xT0FP0ZGZRHDx33RsHwNxwAnZZ+m2+fsyIARKDPPkVjhTu6dtqO97ycYfRRYQQREBWYzzPFB+ZqgSE5IsmP3BT+NH7ar1mDoYJ6TW6MMjDEw7PX7Rew3.WoLJ44OedOhOQPY4tPnijbJ6a7.tN26fc9J22uGwiMhGLC5M1oOUJZK8kw.eVxxAERnWPNmc.w.qjEB+htdbsTMTSzrH.ydRuoCmHuRjh+HdD+LelwvEMDJTpaT6IbeuA2bViPHb4A4m7kRO4uyZetG+V+4cf2lDvNOiY6A3RySoxyQI2GhR8j9dlB7.zCOC8JmRuksFRU7PcdDC2dkUeAb4Ll.s8YoUJVTo.rUaIfPnWMfbAqmBLtMiFa43zzdSGmU1tV0ZUglej19RhxdWkhL009S1GWmTuY8yfWJ75U+jsuGrVFXtMa0b8labxcpynqjcNMAkATZUalkVJ10VydDCPSR.wEdrqqUEXbjzmsZnhKzMxKxwNmbbqSVY6wwBplKE1RwARM6PQiUp9qpUp96p12Mz3wEFyzSTReelpvvFco5wRrgHN3LlpIbJ8iY2BDtrlWM7hmlZfldEMCPonufqOLjkYmqWbKPufxtige8i9cHZhQBk4CvExTZtgN3NrKg4wTAUEqNrnKzxPXh7dpMPyK8h8I54GDLS7YAf9wbJNipRDw0SmcivyX5vovoiBOsOQ5tr0.tlNoX9Vp.9Bcs+27MaWSMqtiGyn5bxV1p2OWzEKOCp7cYrlKNeehVwuFgsNHNXHrtkx.lHDLe3OxBWxnnRscL1lNyPlvKw3uvSVPWiMNKn6MAQADpRdJMcRwrM6kId.NIRVjWA9hBXa6hRldf7rbV0AE.KYOkRMsh2Cbu3bZs.4r9BjyFKPNat.4r0BjyGVfb93ili46a6FqkAoiIfiAcSVifwcEDPkknHQ+CDOfy7I


  • @Alex-Paradis I'm not 100% on how to create an empty 2D Array, but first thing is:

    var previousButtons = [];
    

    will create an Array. Lets see if we can figure out the rest.



  • @dustbro

    I tried your Snippet and I wasn't typing well the arrays.

    All good and working!


Log in to reply
 

4
Online

491
Users

1.7k
Topics

13.0k
Posts