You guys I have a question. I'm trying to write this program, and so far, it's doing mainly what I want it to do, except for one part where I ask the user to input their file name. When they input their file name, (assuming they enter the correct file name), it's supposed to bring up on the screen what's on that file. And so far it DOES do that, BUT, I accidently entered a wrong file name and it brings up everything that is in PetRecords.txt. And I can enter 'any' file name and the info comes up. I know it's something simple to fix this.
And I'm thinking it needs to be fixed around this area:
Um...If you're always specifying that it reads PetRecord.txt, then that's what its going to do. You are specifying a constant value instead of a variable.
Try this line:
Of course, that's not going to work on the line where it's currently declared. You'll have to move it after the declaration of fileName.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joined: Oct 14, 2004
Oh hey, thank you, thank you, thank you!!! I had actually wrote that line of code and removed the PetRecords.txt and put fileName there, but I didn't move the actual code to a different place. Yeahhhhhhhhhhhhhhhhhhhhh, thank you for giving me a tip.... THANK YOU, THANK YOU, THANK YOU!!! :jumpingjoy