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 / Simple Question - If I save numbers to a file, how can I view ?

Author
Message
DemonHill
17
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 4th Jul 2008 02:38
I can see a String when I save to a .dat file for example, but I can't see numbers, they appears as " ÂP " etc.

Is there a tool I can view these in ?

Thanks
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Jul 2008 03:54
If you save numbers to a file as BYTES or WORDS, or LONGS, or FLOATS, you will see the ascii code represented by the byte if you try to view them in a text editor. If you save the number 65, it won't look like 65 when you read it back - it will look like A. If your intention is to save these numbers as numbers indeed, then you can read them back and convert them to a string in DBC itself using Str$() or you can use a Hex editor to view the byte values of the numbers.

In DBC let's save some numbers and then read them back as strings:



If you are reading them back in DBC, you don't have to convert them to strings, I presented this option as a conversion method or if you would want to use the TEXT command to view the values. You can read numbers as numbers just using the print command.

Enjoy your day.
DemonHill
17
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 4th Jul 2008 11:05
many thanx
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Jul 2008 15:40
You also have the option to save the numbers directly as strings. Instead of:



you would use:



In DBC, the strings can be loaded and used/displayed without conversion, but the created file can be opened and viewed in Notepad. If you don't want this to be possible then Latch's method is the way to go.

TDK_Man

Login to post a reply

Server time is: 2025-06-06 00:21:06
Your offset time is: 2025-06-06 00:21:06