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 / File commands problemo

Author
Message
Soyuz
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jun 2003 23:01
I've just had a play at writting stuff out to a file except all I seem to get is a blank file. This is the code I used...



Is this wrong?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Jun 2003 23:05
That should work - I get a 4 byte file. Have you found the correct file (and did it exist before you ran the program) ?

It should contain : Ühê@

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Soyuz
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jun 2003 23:11
Ah ok that file did already exist. I deleted it and tried again and it worked - but surely "open to write" is meant to be for opening an existing file to write too?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Jun 2003 23:18 Edited at: 2nd Jun 2003 23:19
Nope - its only for creating a new file if it doesn't exist already.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Soyuz
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jun 2003 23:33
thanks for the speedy help.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 2nd Jun 2003 23:39
Also if you want it in .txt format then try

write string 1,str$(afloat#)

Else you will get your .txt file in what can only be described as binary format

Pneumatic Dryll

Login to post a reply

Server time is: 2026-07-11 14:55:20
Your offset time is: 2026-07-11 14:55:20