I've been developing a code to print information from a file to a screen. I originally was using functions causing it to error out after about half an hour, I have just changed the code to not have functions in it and now after about 30 mins of run time the programs errors out saying 'startup:12: attempt to index ? (a nil value)' or something similar. But this dose not happen instantly like I said before. I don't know what to do. (Note the file is saved on a disk so that may be moved out of the drive to 'reset' it. That is why I have the first if statement.
Code:
Spoiler











