Jump to content


Photo

Returning The Size Of The Array?


  • Please log in to reply
2 replies to this topic

#1 GMTechnical

GMTechnical

    GMC Member

  • GMC Member
  • 238 posts

Posted 12 May 2010 - 11:59 PM

I am making an example script and I want to know if there is a way to return the size of an array. I could manage without it, but I don't want to have the user pass the size of the array to the script.

Help would be appreciated.
Thanks.
  • 0

#2 unscmaster

unscmaster

    GMC Member

  • New Member
  • 946 posts

Posted 13 May 2010 - 12:07 AM

You could use a for loop to check the value of the array.

for(X = 0; X < MaxX; X += 1;)
{
if Array[X] = 0
{
ArraySize = X;
break;
}
}

Edited by unscmaster, 13 May 2010 - 12:08 AM.

  • 0

#3 GMTechnical

GMTechnical

    GMC Member

  • GMC Member
  • 238 posts

Posted 13 May 2010 - 12:21 AM

Oh yeah. Thanks. :(
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users