the if-case is taken only one time in the while-loop, why?

Hi lar3cry,

at first sorry for my bad english and thanks for your answer:

Well, where to start? It never comes back into the if case because the substring is never equal to 2 again. Substring, with just one argument, takes that to be the starting position of the substring, and without an end argument, goes to the end of the string.

I used this example and I thought and think it's, still, more or less ok. Or I don't understand the example right?
http://arduino.cc/en/Tutorial/StringSubstring

 // substring(index) looks for the substring from the index position to the end:
  if (stringOne.substring(19) == "html") {
    Serial.println("It's an html file");

The variable fromLenght is always 0. I gave me the output with Serial.println(fromLength);

If you want to turn on the LED any time there is a '2' in the String, you probably want the .indexof() function.

That's also an idea to find the right way, but it would be perfectly, if i or someone could find my mistake here now. =(

Frankly, your program baffles me. What is the purpose of sek? you count it down from 2000 to 0, then iterate. Why?

I wanted to the lightning, so i decided to give the light time to glow. That's why i am incrementing for a while at a finding point.
sek should mean seconds. A mistake of me.

continue is totally useless where it is. It is meant to skip instructions within the innermost enclosing loop and continue the loop from the top. In this case, the innermost enclosing loop is the while, and without the continue, it just starts the while loop again anyway.

thanks