I'm sure i press F8, not F7!
Here's my steps:
1. PROJECT menu --> New Project
2. choose "custom program"
3. enter the following code, and save the project as demo.lpi:
program demo;
var
i,n:integer;
begin
readln(n);
for i:=1 to n do
writeln(i);
readln;
end.
4. press f8, lazarus set a gray line under the "begin" (see gif blew), then I continue to press f8, lazarus got the error as the above mentioned.