THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/05/2009 at 04:00, xxxxxxxx wrote:
User Information:
Cinema 4D Version: r11
Platform: Windows ;
Language(s) : C++ ;
---------
hi there, i found several posts here about reading a txt file, but somehow i got stucked.
this is how my code looks atm:
> `
\> String GetfileContent(Filename fn)
\> {
\> AutoAlloc<BaseFile> bfile;
\> bfile->Open(fn, GE_READ, FILE_IGNOREOPEN, GE_MOTOROLA, MACTYPE_CINEMA, MACCREATOR_CINEMA);
\>
\> String singleChar;
\> String line = "";
\> VLONG fileLength = bfile->GetLength();
\> CHAR c;
\> CHAR* pc = &c;
\>
\> for (VLONG i = 0L; i != fileLength; ++i)
\> {
\> bfile->ReadChar(pc);
\> singleChar = pc;
\> // Line read from the file
\> line += singleChar;
\> }
\>
\> bfile->Close();
\> return line;
\> }
\>
`
i thought that when i now call:
GePrint(GetfileContent("filename.txt"));
it should print the content of filename.txt into the console window.. but ot doesnt.
what is wrong here?
thank you for helping
cheers,
ello