View Full Version : problems with array
DuRanG
01-13-2003, 12:12 AM
lets see if i can make it undersandable
i got a big array, and a variable that corresponds to a value of an element of my array. i want to FIND where in the array is this correspondent element.
simontheak
01-13-2003, 09:44 AM
Could you not try some kind of a loop? Something like:
for (i=0; i<=yourArray.length; i++){
if(yourArray[i] == yourVariable){
//do whatever you want your code to do
}
}
Would that work?
this one just tells you if an item is in an array:
http://www.layer51.com/proto/d.aspx?f=6
this will tell your the index of the first element found:
http://www.layer51.com/proto/d.aspx?f=8
this will tell your the index of last element found:
http://www.layer51.com/proto/d.aspx?f=9
DuRanG
01-14-2003, 01:10 PM
yeah i used for here too ;)
simontheak
01-14-2003, 01:12 PM
... and did it work?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.