To start go here and look at the eeword example
http://melabs.com/resources/samples-pbp-general.htm

Then when the user changes the VAR it is written to the EEPROM.
At the beginning of the code, at startup, the EEPROM location will be read and the value moved to the VAR in question.