Originally Posted By: 3run
1. 'file_for_str' reads .txt file line by line till delimiter
2. data which was read from the .txt file is sent into global pointers (vars, strings).
(f.e. you see that 'document_page' in the .txt file, and I have same string in the code, this function will fill up the string with the text from .txt file automatically! this helps me to read such things like 'document title' or 'amount of max pages per document' for each document separately from one .txt file).


Why do you write it to global vars/strings? If you want to "read unlimited amount of pages and documents from single .txt file" you'd need unlimited global vars. I think it's the wrong approach. Read them one by one and save them to a list or something.
I just to read your code again and honestly I don't get it. frown I think it is indeed related to your approaches to read a file several times (though I don't exactly know how and why you actually do it) and recommend to start from scratch again and don't use global vars, but a global dynamic list.