hyperterminal to text file

hey guys.
i have a code that recieved chars from hyperterminal convert it to string and write it on text file
when i use the monitor instead of hyperterminal it work but when i switch to hyper it dosent work
I can not find the problem in the code
I would be happy if you could help
Thanks in advance.

#include <SPI.h>
#include <SD.h>
char inData;
String dataString;
File dataFile();
void setup()
  while (!Serial.available()); // wait for serial port to connect. Needed for native USB port only
  if (!SD.begin(4)) // see if the card is present and can be initialized.
    Serial.println("initialization failed!");
    while (1); // don't do anything more.

void loop()
  if (Serial.available())
    while (Serial.available() > 0)
      dataString = "";
      inData = Serial.read();
      dataString += String(inData);
      /*if (inData == '\n')
        dataString += "\n";
      // open the file. note that only one file can be open at a time,
      // so you have to close this one before opening another.
      File dataFile = SD.open("datalog.txt", FILE_WRITE);

      // if the file is available, write to it:
      if (dataFile)
        // print to the serial port too:
      // if the file isn't open, pop up an error:
        Serial.println("error opening datalog.txt");

Serial monitor sends all data when you hit "send".
Hyperterm sends data one character at a time.

Robin2's serial handling basics tutorial should solve your problem

i think he have been stuck waiting for Port