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

    Get Array Count with arrays within arrays

    Scheduled Pinned Locked Moved Bug Reports
    6 Posts 3 Posters 882 Views 2 Watching
    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 Offline
      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.

      Jack de WildeJ 1 Reply Last reply Reply Quote 1
      • Jack de WildeJ Offline
        Jack de Wilde @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 Offline
          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 Offline
            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 Offline
              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

              Jack de WildeJ 1 Reply Last reply Reply Quote 0
              • Jack de WildeJ Offline
                Jack de Wilde @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

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post