interupting problem

Hi all, I am new to programing.
I am in trouble with a simple patch. What I am trying to achieve is:
Watching button state, printing high or low, if low for some time do series of messages. What my problem is, I want to brake the for loop witch send the messages if press the button. I have read some references about attachInterrupt(), but I am not sure that this is my problem actually.
here is my patch:

#include "Timer.h"

Timer t;

byte afterEvent;    

boolean reading = LOW;
boolean readingPrev = LOW;

void setup() {
	Serial.begin(9600);  
	pinMode(13, OUTPUT);
	pinMode(8, INPUT);
}

void checki() {
	reading = digitalRead(8);

	     t.stop(afterEvent);
	
	if (reading && !readingPrev) {	
		Serial.println("BANG");
		
		readingPrev = HIGH;
	}
	else if (!reading && readingPrev) {
		timer();
		Serial.println("HMH");
		readingPrev = LOW;
	}
}

void loop() {
	checki();
	t.update();    
}

void timer() 
{
	melody1();
}

void melody1() 
{ 

		for(byte i=0; i<5; i++){
			boolean reading = digitalRead(8);
			byte r = random(0, 15);
			if (!reading) {
				Serial.print("HIGH ");
				Serial.println(i);    
				delay(200);
				Serial.print("LOW ");
				Serial.println(i);
				delay(200);
			}
			else {break; checki();}
		} 
}

Can anyone help me?

Thanks in advance!

I want to brake

The spelling is "break" and it's a C keyword.
Look it up and see if it does what you want.

		for(byte i=0; i<5; i++){
			boolean reading = digitalRead(8);
			byte r = random(0, 15);
			if (!reading) {
				Serial.print("HIGH ");
				Serial.println(i);    
				delay(200);
				Serial.print("LOW ");
				Serial.println(i);
				delay(200);
			}
			else {break; checki();}
		}

checki() won’t be called. Anything after the break statement is a waste of time. That code is unreachable. Once you hit the break you leave the whole block.

I don't understand. You mean that I can not interrupt the for loop executing? So is there an other solution?

Sure you can. To stop a for loop and pick up with the next iteration use continue. To kill the for loop entirely use break. But any code inside the loop and after that break statement won't be run. When you break the for loop you leave it entirely. That last line in the else clause is after the break line. So if you hit the break you leave that block entirely, how will you ever get to that last line?

The simple method is to put the test into the for statement like this:

  for(byte i = 0; i < 5 && digitalRead (8) == LOW; i++){
  // whatever
    }

So the loop executes 5 times or until pin 8 does not read LOW, whichever is sooner.

Thanks for all replays!
@Nick Gammon: this solves my problem.
Thanks a lot!