Sorry, didn't see .txt in the attachment list.
Why is this program behaving weirdly. Free Pascal 3.0.4
When the program runs it displays Enter name. Name is entered and press return, the cursor returns to the beginning of the name just entered, it doesn't go to the next line.
If you then press enter, it deletes the name and displays Enter name again and seems to work okay but when the condition zzz is entered, it needs to be entered at least twice before the loop ends.