HISE Logo Forum
    • Categories
    • Register
    • Login

    Find out how many items are inside an Array/var?

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 223 Views
    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.
    • ten7kurT
      ten7kur
      last edited by ten7kur

      Hi all,
      Im pretty sure ive come across this in the past but searching through the forum i cant find it at the moment.

      I need to Print out how many items an array/var has.
      How can i do it?

      Thanks!!

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @ten7kur
        last edited by ustk

        @ten7kur Console.print(myArray.length)

        so when you want to iterate over an array with a for loop:

        for(i = 0; i < myArray.length; i++)
        {
           /*do something*/
        }
        

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • ten7kurT
          ten7kur
          last edited by

          duuh! i knew that!😬
          Thanks for answering!..a stupid question.

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

          48

          Online

          1.7k

          Users

          11.7k

          Topics

          101.8k

          Posts