Originally Posted By: lemming
I was seriously disappointed when in the main you only commented every second line.

I was quite unable to understand what you where trying to do, mainly because your comments killed your code. My favorite lines where:
Code:
// set it's layer:
layer = 1;

// no strings:
strings = 0;

// wait one frame:
wait(1);

Yes, I have to agree with you man.. And you aren't actually a first person who told me about my useless comments for each line...
And even more, I have to say that it's became some kind of a paranoia, so I can't code anything without simply commenting each line frown
This comments aren't just useless.. but they are ridiculous in most cases and they ruined the whole idea of what are they were made for.

About the problem I have (SECOND PROBLEM - still not fixed, all other ones are fixed already).
In order to describe the problem, I probably need to explain how the code works (the one I've posted above).

It's pretty simple so far:
Quote:
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).
This is very simple approach yet it allows me to read unlimited amount of pages and documents from single .txt file and organize them well.
Current problem is, that string wasn't read completely from the file, maybe the loop was broken before the function finished reading it, I'm not sure.
The function that actually reads document text into 'document_page' string is - 'loadDoc(id)', you can see it in the for loop (line 95).
Also right there, before that 'for' loop you can see that I run 'file_for_str' again, that will read the very first line, to get the id for document (document_id).
Thats just a basic reason that I see in my head for this not being viewed correctly, but still if I read the string from the 'file_for_str' function it's correct...

I really hope that you could help me out to track this bug and fix it, or at least give me some ideas where could this bug come from..
I'll look into your example man, thank you for it and for your time as well, but I would like to try fixing my code first, cause I don't want to give up on it.


friendly greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung