HELP GPS

I HAVE GPS Low-power, 12 channel GPS Module AND I NEED COMMAND TO READ ZDA Message
AND I NEED TO SAVE THE INFO FROM GGA Message
MY PROGRASM DOSNT WORK

char cmd;


unsigned char GGA[7]={"GPGGA,"};
unsigned char GPS_info[39];
unsigned char UTC[8]={0,0,':',0,0,':',0,0};
unsigned char GPS_Lat[12];
unsigned char GPS_Lon[13];
void Read_GPS()
{
  boolean Gflag=true;
  while(Serial1.read()!='

);
 for(int i=0;i<6;i++)
 {
 if(Serial1.read()!=GGA[i])
 Gflag=false;
 }
 if(Gflag==true)
 {
  for(int i=0;i<39;i++)
  GPS_info[i]=Serial1.read();
 }
}
void GPS_translate()
{
 int x=0;
 for(int i=0;i<8;i++)
 {
   if(UTC[i]!=':')
   {
   UTC[i]=GPS_info[x];
   x++;
   }
   x+=4;
   GPS_Lat[0]=GPS_info[x];
   x++;
   GPS_Lat[1]=GPS_info[x];
   x++;
   GPS_Lat[2]='';
   for(int i=3;i<12;i++)
   {
     GPS_Lat[i]=GPS_info[x];
     x++;
   }
   x++;
   for(i=0;i<3;i++)
   {
     GPS_Lon[i]=GPS_info[x];
     x++;
   }
     GPS_Lon[3]='
';
     x++;
   for(int i=4;i<12;i++)
   {
     GPS_Lat[i]=GPS_info[x];
     x++;
   }
   }
 }
 void setup()
 {
   Serial.begin(9600);
   Serial1.begin(4800);
 }
 void loop()
 {
   Serial.print("'m'-mesure , 's'-show,'a'-Lat,'o'-Lon,'u'-UTC");
   Serial.print("\n");
   while(Serial.available()==0);
   cmd=Serial.read();
   if(cmd=='m')
   Read_GPS();
   if(cmd=='s')
   for(int i=0;i<39;i++)
   Serial.write(GPS_info[i]);
   if(cmd=='a')
   for(int i=0;i<12;i++)
   Serial.write(GPS_Lat[i]);
   if(cmd=='o')
     for(int i=0;i<13;i++)
   Serial.write(GPS_Lon[i]);
   if(cmd=='u')
   for(int i=0;i<8;i++)
   Serial.write(UTC[i]);
   Serial.print("\n");
 }

Please edit your post, select the code, and put it between [code] ... [/code] tags.

You can do that by hitting the # button above the posting area.

Also please don't use all caps - it looks like you are shouting at us.

If you post your code between code tags, we will be able to read it.
However, from a quick scan, I'd say you can't compare the int returned by Serial.read to an array.

If you go back to your post, click on "modify", then highlight the code, click on the # icon on the editors toolbar, then click on "save".

Edit: ok, you're not comparing an int to an array, but if you'd posted correctly, that would've been more obvious.

  while(Serial1.read()!='

The for loop executes as soon as there is one byte to read. You then read 6 of the one bytes available. The likelyhood of all 6 bytes arriving faster than the Arduino can read them is about the same as my winning the lottery two weeks in a row, without buying a ticket.

There is a start of packet marker for every NMEA sentence, the $ sign, and an end of packet marker (left for you to determine). You need to store all the data starting when the start maker arrives, and ending when the end marker arrives. Then, you parse the stored data.);
  for(int i=0;i<6;i++)
  {
  if(Serial1.read()!=GGA[i])
  Gflag=false;
  }


The for loop executes as soon as there is one byte to read. You then read 6 of the one bytes available. The likelyhood of all 6 bytes arriving faster than the Arduino can read them is about the same as my winning the lottery two weeks in a row, without buying a ticket.

There is a start of packet marker for every NMEA sentence, the $ sign, and an end of packet marker (left for you to determine). You need to store all the data starting when the start maker arrives, and ending when the end marker arrives. Then, you parse the stored data.