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 / asc and chr$ are not compatible

Author
Message
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 8th Dec 2013 11:26 Edited at: 8th Dec 2013 11:27
Hello. There is a big problem with asc and chr$.

Here is code that should produce the same as shown on BMP from DBP help (help -> principles -> ascii).



The result is far from the master image. I mean characters that are not 0-9 A-Z a-z (ie >128 and further)



Also I tried to write a list of characters backwards, using asc. The resulting list is the same as in master image.

Why those commands are incompatible?

p.s. "set text font" doesn't help

Attachments

Login to view attachments
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 8th Dec 2013 11:46
Hmm... oddly some text editors open file as "866 OEM" encoding, not the "1252 ANSI". It is okay if you want MS-DOS characters (176-223), but everything eles is on other positions. And if change (for f = 32 to 255) to (for f = 192 to 255) all text editors open it as "1252 ANSI". Why that so?

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Dec 2013 14:33 Edited at: 8th Dec 2013 15:05
Quote: "The result is far from the master image."


They look the same to me with just a few exceptions, e.g. several square symbols showed up as spaces. Everything else seemed to be the same to me.

Edit Here's an image made from the output of your program:





Powered by Free Banners

Attachments

Login to view attachments
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 8th Dec 2013 19:46 Edited at: 8th Dec 2013 19:47
here is mine (from chr$)


Attachments

Login to view attachments
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Dec 2013 22:52
Mine match the "master" image just fine.

Quote: "e.g. several square symbols showed up as spaces"

I think that's just dependent on how a particular program wants to display non-displayable characters.

Handy, yours does appear to be displaying the old DOS charset. What program are you viewing the document in? What version of windows?

mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Dec 2013 00:42
Total Commander, also AkelPad. Want to try out Notepad++

Login to post a reply

Server time is: 2025-05-17 16:52:58
Your offset time is: 2025-05-17 16:52:58