Ok here is the working version:
void top_menu_function_4() //Display a list of the alarms and times.
/*
What I have learnt:
alarm_EEPROM_storage+n (where n is the alarm number) yields 0,1,2,3
0 = off
1 = Daily
2 = M-F
3 = Weekend
4 = Once
bit of information about the RTC alarms.
clock1.alarms[ala].hr;
clock1.alarms[ala].mnt;
clock1.alarms[ala].dow;
*/
{
byte foo[4];
byte boo;
char msg1[9];
char msg[14];
int i;
lcd.setCursor(0,0);
for (int i=0;i<Max_alarms;i++) // the 0 and Max_alarms are now needing to be other variables.
{
// from here......
sprintf(msg,"Alm %1d %2d:%02d ",i, clock1.alarms[i].hr, clock1.alarms[i].mnt);
boo = clock1.alarms[i].dow;
lcd.print(msg);
if (boo == 0)
{
lcd.print("OFF");
}
if (boo == 1)
{
lcd.print("Daily");
}
if (boo == 2)
{
lcd.print("Week Day");
}
if (boo == 3)
{
lcd.print("Week End");
}
if (boo == 4)
{
lcd.print("Once");
}
// to here........
}
wait_on_escape(8000);
// Code in here to control start and stop numbers.
return;
}
Ok: max_alarms is how many alarms in the code. It is now 5. That is one too many to display on the screen at once.
Looking for the "From here....." "to here......"
That part needs to be a thing which I can do with 4 loops, and then call it with variable start and stop numbers for the loop controlled by code I put at the bottom.
But all the "variables" need to be passed/seen in the function thingy.
Is that better explained?