I've been trying to learn how to parse a text file and make it play music when specific sentences show up.
An example might be "You have entered XXXX zone." which would cause music to start.
My question right now is, what is the best way to handle parsing when the program reaches the end of the text file and needs to idle until some new text is logged.
I think maybe setting a variable to the size of the text file then comparing that to itself in an infinite loop. Presumably if something new is written to the log file it's size will change. But i'm not certain how accurate the size comparison tests are.
and I'm new at this so there might be another way to do it that is better :)