send sms on start up

The code below does send a sms but the lat and lon value =000000 and When I type "T" i send an sms with a proper value of lat and lon

void loop() {
char                c;
unsigned long       timeout             = 0UL;

Serial.println("Press 'T' to send coordinates via Text.");
delay(1000);
while (true) {
      if (Serial.available()) {                               // did user hit 'T' key to force text?
        c = Serial.read();
        while (Serial.available())                          // flush buffer
            Serial.read();
        if (c == 'T' || c == 't') {
            ssGprs.listen();                                // listen to GPRS while we send coordinates
            sendCoord();                                    // send coordinates as SMS msg
            ssGps.listen();                                 // go back to listening to GPS            
          }
        }

    doGpsIo();                                              // decode next GPS character

    if(sendtxt==false){
        ssGprs.listen();                                // listen to GPRS while we send coordinates
        sendCoord();                                    // send coordinates as SMS msg
        ssGps.listen(); 
    }  

    if (millis() > timeout) {                               // ever <timeout> secs,  check for SMS
        if (debugMode)
          gpsTest();
          ssGprs.listen();                                    // start listening to GPRS
          doSmsMsg();                                         // check for incoming SMS and respond w/ coordinates
          ssGps.listen();                                     // go back to listening to GPS
          timeout = millis() + textScanTimeout * 1000UL;      // determine next time to check for SMS
        }

    } // main while        
}

The code below does send a sms but the lat and lon value =000000

If the SMS is sent before you press a T, then it happens in setup(), which you failed to post.

You also failed to post a lot of other functions.

You are going to continue to experience problems with multiple instances of SoftwareSerial. You REALLY need to bite the bullet, and get a Mega.

PaulS:
If the SMS is sent before you press a T, then it happens in setup(), which you failed to post.

You also failed to post a lot of other functions.

You are going to continue to experience problems with multiple instances of SoftwareSerial. You REALLY need to bite the bullet, and get a Mega.

Tnx for the concern but it works well on Uno, I change the the objective to; if the gsm receive a sms it will reply the location and delete all the message receive and it works fine, but my problem now is preventing buffer overflow let' say the serial has 30% of overflow

but my problem now is preventing buffer overflow

Which buffer are you trying to keep from overflowing?

You need to take your snippet to http://snippets-r-us.com.