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 / Problems With DbWriteFiles

Author
Message
Klas Wullt
14
Years of Service
User Offline
Joined: 7th Dec 2009
Location: sweden
Posted: 7th Dec 2009 14:56
each time I try to write a save with DbWriteFile
nothing is written to the file.

I dont understand these dbcommandos at all.

Can anyone show me how to make a file
,write to it
and jump through different positions of data.

I need to save arrays and class objects.


Thank you in advance,
Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 8th Dec 2009 00:29
use fstream. you write lines and read lines

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 29th Dec 2009 12:32
its really simple

when you use dbOpenToRead("textfile.txt",1); or whatever, then you use dbReadString(1)... that reads the whole first line. if you use dbReadString(1) again it will read the second. if you use it again it will read the third and so on.

the same for dbOpenToWrite... but with dbWriteString(1) or whatever your file number is... note that its hard to get normal strings to work with dark gdk... so instead use chars... for example...

char *variable;

to convert that string to an integer theres the atoi() command...
so if you want to read a number and use it as an integer use it lik this

variable=atoi(dbReadString(1));

that is for reading only... to write a number you have to convert the number to a string... (char *) and then write it... hope it helps

hi

Login to post a reply

Server time is: 2024-11-20 09:25:13
Your offset time is: 2024-11-20 09:25:13