[thelist] C#- using info from an arraylist
Lightning
oktellme at earthlink.net
Fri Sep 8 20:59:48 CDT 2006
Passenger arraylist contains START, END, DIRECTION where start and end are
integers and direction is enum.
I am looping thru arraylist, looking for instances where END = i , and if
direction also matches, I will delete it.
ELEVATOR
foreach(Passenger intEndFloor in PassengersOnCar) //<< this line does not
compile
{
if (intEndFloor == intFloor && dirDirection == Direction.Up)
{
// if passenger wants this floor, discharge
PassengersOnCar.Remove(Passenger); //<< this line does not compile
intdischargedPassengers++;
}
}
Can anyone help?
thanks
Laura
More information about the thelist
mailing list