THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/02/2003 at 17:55, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.012
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
---------
The code needs to read in a file and parse it, line by line. But, there is no ReadLine() function, so I created one myself. Let me know if this might work or if there is another approach.
filelength is set to basefile->GetLength() right after calling basefile->Open() in another function.
FileParser::ReadLine(basefile)
{
// Read in a line of text (until EOL) from file
var onechar ;
var line;
// Keep reading until EOL or EOF is reached
while (basefile->GetPosition() < filelength)
{
onechar = basefile->ReadString(1, GE_XBIT);
if (onechar != '\n')
line = stradd(line, onechar);
else
return TRUE;
}
// Unexpected EOF
return FALSE;
}