EEPROM Errors When Writing

I have been working on a Bluetooth serial buffer and finally got it working. When I send the text "ep100" it saves 100 to the Variable[29]. Now to the problem. When I set Variable[29] to 100 and then call this function below, it only allows me to save the eeprom 4 times and then it doesn't let me do it anymore. When I set Variable[32] to 100 it loads the EEPROM values. This works every time without fail. Does anyone know why I can't save data more than 4 times? The "int Variable[VarNum];" is declared outside the Setup() and Loop().

Thanks guys.

#define VarNum 33
int Variable[VarNum];


void loadEEPROM() {
  if ( Variable[32] == 100) {
    for (int i = 0; i < VarNum; i++) {
      Variable[i] = EEPROM.read(i);
    }
    EEPROM.update(32, 0);
    Variable[32] = 0;
  }

  if (Variable[29] == 100) {
    Variable[29] = 0;
    for (int i = 0; i < VarNum; i++) {
      EEPROM.update(i, Variable[i]);
    }
  }
}

I found what was causing the problem but am not sure if it could be an error. The EEPROM library has a flag that goes off after 100 eeprom writes. This being said, I am using the update function and would think that it would not write anything to the my Variable array. Does anyone understand why it is giving me the feedback "Exceeded maximum number of writes" in my serial monitor.

I can change the maximum value by calling EEPROM.setMaxAllowedWrites(//Some number);

Thanks

Can you post all your code please? I don't see anywhere that it writes "Exceeded maximum number of writes" nor where it opens the serial port.

http://snippets-r-us.com/