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 Discussion / ASCII character output

Author
Message
Tibbs
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location: Kalamazoo, MI
Posted: 12th Oct 2004 10:56
I am working on a small AI program with a friend, he is writing the "reader" in C++ (because DB isn't that fast), and I am writing the "writer" in Dark Basic. When you output float, long, word, (etc) to a file, and then try to read that in notepad or simple text, it appears as jibberish. Is there any way to output just plain ASCII characters such as the ones you are reading now? Any help would be GREATLY appreciated!

-Tibbs

Pyrokinesis.gotdns.com
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 12th Oct 2004 12:27
If you want to write a number just convert it to a string with STR$() and use WRITE STRING to write it to the file.

a# = 123.456
write string 1,str$(a#)

However it is easy to read to read the binary output (jibberish) outputed by db in C/C++. You just read the file the same as any other binary file with the exception that strings are teminated by chr(13)+chr(10).

Shrink dbpro exes with upx
can i scream?
Tibbs
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location: Kalamazoo, MI
Posted: 13th Oct 2004 07:34
When you write the string containing the number, will it (when you open the text file) show the binary-encoded string or will it have just plain text?

Pyrokinesis.gotdns.com
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 13th Oct 2004 17:52
Plain text.

[img src=http://blanky.pt-web.net/ddd.gif] >::p
Tibbs
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location: Kalamazoo, MI
Posted: 14th Oct 2004 05:30
Thank you immensly guys! I appreciate it.

Pyrokinesis.gotdns.com

Login to post a reply

Server time is: 2025-05-24 16:59:19
Your offset time is: 2025-05-24 16:59:19