grapevine
05-26-2007, 07:32 AM
I am accessing some information from 4 arrays where I only to want to view certain categories from the array which has 25 variables in it
eg: var trainDestination = new array ('Diss','Norwich','Diss', 'Ipswich',....etc)
eg: var trainTimes = new array('10.00','12.00','13.00','14.00.....etc)
I also created a new array to allocated a number to each of the times
var = trainNumber=new Array(trainTimes.length)
I can write a for statement to view all of the list, but I can not change the statement to view only Diss times or only Norwich times etc. This was my original for statement
var train=0;train<Times.length;train=train+1)
{trainNumber[train]=([train+1])
I have tried changing
var train = 3 to start at the first occurence of say Ipswich but I really do not know how to get it to look at the other occurences.
As you can see I am very novice as this is a new area for me. Any help on how to extract specific bits from the array would be most appreciated.
Many thanks :confused:
eg: var trainDestination = new array ('Diss','Norwich','Diss', 'Ipswich',....etc)
eg: var trainTimes = new array('10.00','12.00','13.00','14.00.....etc)
I also created a new array to allocated a number to each of the times
var = trainNumber=new Array(trainTimes.length)
I can write a for statement to view all of the list, but I can not change the statement to view only Diss times or only Norwich times etc. This was my original for statement
var train=0;train<Times.length;train=train+1)
{trainNumber[train]=([train+1])
I have tried changing
var train = 3 to start at the first occurence of say Ipswich but I really do not know how to get it to look at the other occurences.
As you can see I am very novice as this is a new area for me. Any help on how to extract specific bits from the array would be most appreciated.
Many thanks :confused: