this could also be "can variable names be dynamic?" I guess...
The internet is looking like this is something that cant be done... but ill ask anyways.
Id like to turn this...
if(highScoreNum==0){
EEPROM.writeBlock<char>(addressCharArray1, buf,3);
}
if(highScoreNum==1){
EEPROM.writeBlock<char>(addressCharArray2, buf,3);
}
if(highScoreNum==2){
EEPROM.writeBlock<char>(addressCharArray3, buf,3);
}
if(highScoreNum==3){
EEPROM.writeBlock<char>(addressCharArray4, buf,3);
}
if(highScoreNum==4){
EEPROM.writeBlock<char>(addressCharArray5, buf,3);
}
if(highScoreNum==5){
EEPROM.writeBlock<char>(addressCharArray6, buf,3);
}
if(highScoreNum==6){
EEPROM.writeBlock<char>(addressCharArray7, buf,3);
}
if(highScoreNum==7){
EEPROM.writeBlock<char>(addressCharArray8, buf,3);
}
if(highScoreNum==8){
EEPROM.writeBlock<char>(addressCharArray9, buf,3);
}
if(highScoreNum==9){
EEPROM.writeBlock<char>(addressCharArray10, buf,3);
}
into something like this...
EEPROM.writeBlock<char>(addressCharArray+(highScoreNum+1),buf,3);
the internet it looks like is saying maybe this isnt possible and that possibly addressCharArray# should be in an array...
and that would be ok, but then it changes my question.
my question would then be,
how do i put my variable declarations into an array when they look like this...
int addressCharArray1 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray2 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray3 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray4 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray5 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray6 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray7 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray8 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray9 = EEPROM.getAddress((sizeof(char)*3)+1);
int addressCharArray10= EEPROM.getAddress((sizeof(char)*3)+1);
EDIT:
ooooh.... i think i know how....
int addressCharArray[10];
addressCharArray[0] = EEPROM.getAddress((sizeof(char)*3)+1);
(etc etc)
ima give it a go...
i shoulda pondered it more before asking. sorries