// GLOBALS=======================================================
BOOL firstopen;
// FUNCTIONS=====================================================
void DebugOut (char *string)
{
//---------Locals---------//
FILE *stream;
//------------------------//
if (firstopen = TRUE)
{
stream = fopen("debug.txt", "wt");
}
else if (firstopen = FALSE)
{
stream = fopen("debug.txt", "w+t");
}
fprintf(stream, "%s\n", string);
if (firstopen = TRUE)
{
firstopen = FALSE;
}
fclose(stream);
}
All it does is write over the first line. I can''t get it to write on the next line.
Writeing A Text File
I am going out of my mind. I can''t get this file access to work. It should work, unless I missed something.
------------------------------------------------------------I wrote the best video game ever, then I woke up...
it might be because your testing statements have the assignment operator instead of the equality operator.
i.e.
if (firstopen = TRUE)
instead of
if (firstopen == TRUE)
try replacing the = with == and see if that works.
i.e.
if (firstopen = TRUE)
instead of
if (firstopen == TRUE)
try replacing the = with == and see if that works.
Nope..
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Try using ''a'' instead of ''w''. That''ll have it append everything you write to the end... not sure if that''s what you want.
-Agent1
Encrypted Transmission from Flagg, sent Tue Sep 19, 2000 4:45 PM:
hehe... we''re gonna have to change our number to unlisted...
-Agent1
Encrypted Transmission from Flagg, sent Tue Sep 19, 2000 4:45 PM:
hehe... we''re gonna have to change our number to unlisted...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement