The idea was to open a file with a list of names, ask the user for a name, check if it alreasy exists in the file, and if it doesn't, add it to the end of the file in a new line.
The first time it finds a duplicate name everything works OK and it urges the user to give another name. The problem is that if the name I try next is also a duplicate it adds it to the file. For some reason the 'nametaken' doesn't change from 'no' to 'yes' when it finds the duplicate.
I know the program is a mess, so if you have any suggestion about changes that would make my life easier, feel free to post.