www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/01/13:44:54

To: djgpp AT delorie DOT com
From: enlar AT arrakis DOT es (Eneko Lacunza)
Subject: type conversi¢n
Date: Thu, 01 May 1997 16:52:00 +0000
Message-ID: <GoldED.199705011720548301.enlar@arrakis.es>
Sender: enlar AT arrakis DOT es (Eneko Lacunza)

Hello All!

    Please, any reply via e-mail, I'm having trouble with the newsgroup and 
I'm
not subscribed to the mailing-list.

    Well, some days ago I posted a help request with a problem that I
believed
was PDCurses related. But I've discovered that it's DJGPP related...

    It was that if I tried to do "addch('³')" (or any character >127) , it
appeared on the screen with all the attributes set. After some days, and
with
a great help from Alaric Dailey (thanks!), I've discovered that it was
caused
by the type conversion. The character type in PDCurses is a long integer, so
the compiler "tried" to convert the char into an long integer. But since the
characters are SIGNED, it converted the char to 0xffffff??, although the
"expected" was 0x000000??, a character without any attributes. So here it
is.

    Because of that, I have to force an AND comparison to be sure the long
value to be the character's value. Does anyone know another way for doing
this
in a (probably) more "polite" way?

    By the way, does anybody know why the character type is signed, and not
unsigned??? I've always seen the IBM extended ASCII tables from 0 to 255, so
what? (only wanting to know the reason, sure it's right).

    Thanks in advance.

Greetings, Eneko.
Fidonet 2:344/19.11 | 2:344/20.13
e-mail: enlar AT arrakis DOT es

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019