Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / saving int to .txt file

Author
Message
pokimon
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location:
Posted: 1st May 2010 22:34
i use

dbOpenToWrite (1,"file.txt") ;
dbWriteWord(1,score);//score is int
dbCloseFile (1);


but after all of that the file.txt is still empty
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 1st May 2010 23:53 Edited at: 2nd May 2010 04:14
its been said before on this forum. please use the search option below... it is not recommended you use the file commands of dgdk... use fstream http://www.cplusplus.com/doc/tutorial/files/

And i think the file must not exist to use that command

EDIT: i use the built in functions to read only. not to write

hi
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 8th May 2010 18:23
You can use, .save instead of .txt and it works fine...

from Helpfullprogrammer.
Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 9th May 2010 02:52
Example of File I/O



thats a basic idea of file i/o. any questions, just ask.

I soon plan to release a dlls that i created, one of them is a file dll for writing to and from text files.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Serial Velocity
16
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 10th May 2010 17:49
I have a file class in my utility library (in my sig) that you could use, which uses fstream as a base. An example is here:



Output is 10.

GDKUtilities, a utility library for DarkGDK, avaliable here

Login to post a reply

Server time is: 2024-11-19 23:44:18
Your offset time is: 2024-11-19 23:44:18