turn a pin on with trigger 1 and turn off with trigger 2 ( time related)

Hello All

Thanks for any suggestions in advance.

My question is .. from my cut of code below which is how I have been checking the alarms have been triggered ... What would be the best way to get AlarmHour 1 & AlarmMinute 1 to turn on a output and keep it on till AlarmHour 2 & AlarmMinute 2 comes around and turns it off. of course will stay off till AlarmHour 1 & AlarmMinute 1 turns it on again.

if ((AlarmHour[1]==Hour) && (AlarmMinute[1]==Minute)) {
  Serial.println ("alarm 1 is rininging"),delay(250);
}
else
{
  Serial.println (" Alarm 1 is off"),delay(250);

  if ((AlarmHour[2]==Hour) && (AlarmMinute[2]==Minute)) {
    Serial.println ("alarm 2 is rininging"),delay(250);
  }
  else
  {
    Serial.println (" Alarm 2 is off"),delay(250); 

    if ((AlarmHour[3]==Hour) && (AlarmMinute[3]==Minute)) {
      Serial.println ("alarm 3 is rininging"),delay(250);
    }
    else
    {
      Serial.println (" Alarm 3 is off"),delay(250); 


      if ((AlarmHour[4]==Hour) && (AlarmMinute[4]==Minute)) {
        Serial.println ("alarm 4 is rininging"),delay(250);
      }
      else
      {
        Serial.println (" Alarm 4 is off"),delay(250); 




      }

    }
  }
}

How about setting a boolean variable to true when the alarm is first triggered, carrying out whatever actions are required whilst the variable is true and setting it to false when the second alarm is triggered ?

How about posting ALL of your code, too, so that we can see that you are declaring and using the arrays properly?