98 Ford Contour (Bad crankshaft positioning sensor)
Thought I would share this for info purposes just in case you are having this problem.
Car was running fine up until it would not start. Car would then start intermittently only to run for a couple minutes, then sputter out and die.
Other symptoms were:
Gas gauge would not work even with half a tank of gas when it was stalled, but would work when the the engine did happen to run intermittently.
Engine light came on but did not show up as the test code for the crankshaft positioning sensor when tested. I had to test the sensor manually to find out it was bad.
Engine light was popping on from time to time for 3 or 4 months before sensor gave out completely.
Looking back I suspect the sensor had been going bad for a while due to diminished gas mileage and rough idling along with the strange acting check engine light.