Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    Question the array lenght

    For some reasons I don't want to specify the lenght of an array, but I need later to use that value. Is it possible?

    var a = new Array()
    a[0] =
    a[1] =
    a[2] =

    I need something like a.lenght to use this value in an incremental loop...

    for(i=0;i++;i<a.lenght)...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts

    Re: the array lenght

    Originally posted by Kor
    For some reasons I don't want to specify the lenght of an array, but I need later to use that value. Is it possible?

    var a = new Array()
    a[0] =
    a[1] =
    a[2] =

    I need something like a.lenght to use this value in an incremental loop...

    for(i=0;i++;i<a.lenght)...
    for(i=0;i++;i<a.length) {

    }
    should do the trick
    I am the luckiest man in the world

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    it should be

    for(i=0;i<a.length;i++)

    not

    for(i=0;i++;i<a.length)
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    Thank you

    thank you
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •