3. Writing your first for loop


#1

I keep getting the message that says :

The program took too long to finish. Check your code for infinite loops and try again.
and the program does not compile again after that.


#2

Navigate to the previous lesson. Set the screen zoom high enough to remove the preview window from view. Now proceed to the next lesson.

Click Reset immediately. Now add this line above the working code area:

<?php else ?>

<?php 

    // working code area

?>

Now restore normal zoom and refresh the page. This will give you a stable environment in which to write your code. When ready to test, cut the line with the error (the one we added) and Save and Submit.

If the lesson fails, paste it back in and repair the code. If it passes, proceed to the next lesson and paste that line in immediately. Proceed with writing code as before, and continue.

What that line of code does is raise a parse error which disables the auto-refresh. This is really useful if the lesson involves any loops.


#3

this was so helpful thank you. it worked like a charm :slight_smile: