I am trying to loop through an array were the first element is either a 3, 4, or 7 the second value is any number between 1 and 2048.
The number of rows in the array is random.
example of array:
3 200
4 50
3 100
3 100
3 100
4 50
4 25
The first rows where [element 0 = 3] need to have [element 1] added together and then set equal to a variable.
The first set of rows where [element 0 = 4] need to have [element1] added together and set equal to a variable.
Using the example array the value of the variables should be ele3 = 200 and ele4 = 50.
Then I need to call another subroutine that process those variables
.
Here is where I get stuck
I need to go back to that loop and start at the next row in the array and find all the [element 0 = 3] add up the [element 1] set them equal to same variable as the before ele3.
Find all the [element 0] = 4 and add up the [elements 1] and set it equal to the same varable ele4 and pass them to the sub routine.
Using the example array the value of the variables (the second time) should be ele3 = 300 and ele4 = 75.
If the the value of [element 0 = 7] it should just report it as an error and fail.
edited: Tue Sep 10 02:48:38 2002 by jeffa - s/\[/[/g