About Store Forum Documentation Contact



Post Reply 
FileText::getLine() skips the first word?
Author Message
yvanvds Offline
Member

Post: #1
FileText::getLine() skips the first word?
Hey.

I just wrote a trivial routine to get lines of text from a file. Funny thing though: the first word on a line is always skipped. Nothing I can't work around, but it seems like an error:

PHP Code:
FileText f;
Memc<Strstorage;
if (
f.read("Data/manual/tips.txt")) {
    for (;
f.level();) {
        
Strtext storage.New();
        
text f.getLine();
    }


Edit:

So I can do it like this, but it would seem more logical to me if I could use the level function in a plain text file, where everything is on the base level:

PHP Code:
while(f.getLine() != "") {
    
Strtext storage.New();
    
text f.text;

(This post was last modified: 07-19-2011 12:53 PM by yvanvds.)
07-19-2011 12:42 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: FileText::getLine() skips the first word?
use !f.end() instead of f.level
07-19-2011 01:15 PM
Find all posts by this user Quote this message in a reply
Post Reply