logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Get Array Count with arrays within arrays

    Scheduled Pinned Locked Moved
    Bug Reports
    3
    6
    284
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Aidan_FireA
      Aidan_Fire
      last edited by

      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.

      Jack8680J 1 Reply Last reply Reply Quote 1
      • Jack8680J
        Jack8680 @Aidan_Fire
        last edited by

        @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\"]"]

        1 Reply Last reply Reply Quote 0
        • Aidan_FireA
          Aidan_Fire
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • HamedH
            Hamed Admin
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • Aidan_FireA
              Aidan_Fire
              last edited by

              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

              Jack8680J 1 Reply Last reply Reply Quote 0
              • Jack8680J
                Jack8680 @Aidan_Fire
                last edited by

                @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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post