@7vinbaby:
You don't have to start a new thread.
Not sure what you want to do. But this is my guess:
begin
num := 0;
count2:= 0;
repeat
ClrScr;
writeln('Press Enter to continue or ESC to exit.');
ch := ReadKey;
if ch=#13 then begin
example1; // find num
example2; // find count2
if (num=0) and (count2=0) then begin
writeln('keep');
readln;
end
else begin
example3;
example4;
end;
end;
until ch=#27;
end.
Advice for novices:
Don't use non-descriptive names (num, count2, example1, example2, ...), that will only burden your brain to work harder to guess what it is for. Using descriptive names is very helpful especially when your code grows to thousands of lines of code.
edited:
I modify the code a bit to make it better.