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.

DarkBASIC Professional Discussion / question about writing and reading files

Author
Message
The Fat Centurion
20
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Swindon, UK
Posted: 31st Dec 2005 18:42
Hi and happy new year to all,

I have a wierd problem, my understanding in DBP is getting bigger by the day but I have hit a small problem.

Im making a load and save function in my program and im geting some wierd efects from it.



Now the problem is when i set the arrays up they hold the correct numbers (will say 26355, 30 and 1), yet once iv saved it and loaded the array back in all numbers are 0 . Loading being the reverse to saving.

I have read that you can change the numbers to strings and change them back on return but if i can i would like to keep them as numbers.

Can anyone give me any insight on whats going wrong or is it just me

Thank you all for your time
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 31st Dec 2005 20:40 Edited at: 31st Dec 2005 20:41
Try


If the file exists you need to delete it before using OPEN TO WRITE, otherwise dbpro won't write to the file.

By way of demonstration, he emitted a batlike squeak that was indeed bothersome.
The Fat Centurion
20
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Swindon, UK
Posted: 31st Dec 2005 22:03
the_winch, Hi

Thanks for the reply, yes i do have it so that it deletes the same file.

If i make these strings all is ok, its just when i use read/write word, byte

Funny thing is that it also works if i make them integers, havent tried long int yet but im sure that one will work to.

strange huh..

the_winch have a happy Newyear to buddy..

Login to post a reply

Server time is: 2025-06-03 18:10:34
Your offset time is: 2025-06-03 18:10:34