looping problem

hi all,

Im working on a small compass/gps datalogger. The program works for the most part, the only problem is that the compass reading only prints once, rather than 100 times each time the full program loops. After the first loop of serial gps readings, it prints one compass measurement, then waits 10 seconds and loops through the gps readings again. Does anyone have an idea as to why it might be doing this, instead of completing the entire for loop?

thanks for any advice or insights

#include <NewSoftSerial.h>
#include <Wire.h>
#include <SD.h>
int CS=8;
NewSoftSerial nss (3,4);
char inData[250]; 
byte index = 0; 
int HMC6352slave =0x42;
int HMC6352read = 0x41;
int heading;
long id = 1;
void setup()
  HMC6352slave = HMC6352slave>>1;
  Serial.begin (115200);
  nss.begin (9600);
  pinMode (CS,OUTPUT);
    Serial.println("Card Failure");
void loop()

  for( int j=0;j<10000;j++)
    while(nss.available() > 0)

      char inChar = nss.read();
      if (index < (250))
        inData[index++] = inChar;
        inData[index] = '\0';
        if (index == (250))
          File gps = SD.open("gps.txt",FILE_WRITE);



  for(int k=0;k<100;k++);
    delay (10);
    Wire.requestFrom(HMC6352slave, 2);
    byte MSB = Wire.receive();
    byte LSB = Wire.receive();
    float headingSum = (MSB<<8) + LSB;
    float headingInt = headingSum/10;
    File compass = SD.open("compass.txt",FILE_WRITE);
  int k = 0;



Your problem is that the semicolon on this line should not be there:

  for(int k=0;k<100;k++);


I've been looking at the same piece of code for for too long