Get Array Count with arrays within arrays



  • Get Array Count gives a blank value when it tries to get the count of an array that has arrays in it. Take this array for example and try to get the count of it:
    ["["array11","array12"]","["array21","array22"]"]
    The result is nothing, but it should be 2.



  • @Aidan-Oxley you need to escape the quotation marks so hyperPad knows that they are not part of the main array. It should be
    ["[\"Array11\",\"Array12\"]","[\"Array21\",\"Array22\"]"]



  • Oh, if I read through the other forum posts about arrays more carefully I would've read about the slashes.


  • Admin

    I actually didn't know about the backwards slashes :thinking: it makes sense though because backslashes are known as escape strings.



  • Wow, you don't need to escape them I think. I just used hyperPad to create the arrays rather than trying to type the array out, and it gave me this:
    [["array11","array12"],["array21","array22"]]
    Get Array Count gives 2



  • @Aidan-Oxley interesting, I think it doesn't need to escape them there because it's not putting quotation marks around the inner arrays. I guess that makes sense, but escaping them should work too I think.


Log in to reply
 

Looks like your connection to hyperPad Forum was lost, please wait while we try to reconnect.