reading the serial port

thank you for your help. some of you at least.

Hey, you don't need anyone's attitude because you already got one of your own even if you think not. Yes, people asking for code help are expected to co-operate and put in real effort. Just repeating 'gimmie' tends to turn the help you wanted away. And besides, I'm not at my best up at 4AM because of a toothache. Note that the other members have lives as well. They are not asking You for help. Think about that before being affronted and think of your own part as well.

For your own good you need to learn this stuff and frankly just dropping code on you is only going to lead to more questions about the parts you hadn't guessed mattered. If what you get isn't exactly what you need, how are you going to modify it if you don't know how most of it works?

In my 15 years of using forums there's always 1 commin Rule: SEARCH before you ASK!

From Nick Gammon, a major wizard here:

How to process incoming serial data without blocking

If you can learn that, you will be at least 5 steps ahead of where you are now.

Here's the Arduino site Playground -- a place to find code you can use:
Look under Input then serial. My oh my, what a lot of articles right there just for looking.
http://playground.arduino.cc/

Whatever else you learn, you should learn how to find things on your own. It is a basic skill.
Even if you don't get it all yourself at least you can find out enough to ask good questions.