April 25, 2024, 01:55:04 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Is there something strange about this character: ÿ

Started by AdrianFox, January 27, 2014, 10:48:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AdrianFox

January 27, 2014, 10:48:39 AM Last Edit: January 27, 2014, 11:04:15 AM by AdrianFox
This is just bizarre!   I have a program to display various foreign language characters including the Ÿ and ÿ characters.   They are all displayed on a simple colour button..... except for ÿ!    It is simply CHR$(255) which I can print to my edit box or type with the ALT key, but which simply refuses to display in my button definition.

CONTROL French,@BUTTON,"ÿ",395,477,34,25,0,BUTTON28

I have also tried:

CONTROL French,@BUTTON,chr$(255),395,477,34,25,0,BUTTON28

But both result in a blank button


If I simply change the button definition to

CONTROL French,@BUTTON,chr$(231),395,477,34,25,0,BUTTON28  it displays the ç without problems.

(or any other standard characters for that matter!  I have used all the French character set without any similar problems.)

So does anybody have any theory why this character might be refusing to show in my button?  Is it some kind of 'reserved character' in Windows or something?

>:( >:( >:(

UPDATE:

Found a sort of answer in a comment on a bug experienced in Visual Basic: "It almost definitely not the character itself, but rather its ASCII value that's special. 'ÿ' is character 255 (0xFF), meaning it's the highest value that can be stored in an unsigned byte, and all its bits are set to 1.

Doesn't solve my problem of displaying it though I will go and try displaying itself alongside another character or perhaps by indicating 'lc Ÿ ' on the button!  FOUND a way, which is to display it as ".ÿ" which works, though not entirely satisfying!
Silly me!  This solves the problem  " "+chr$(255)  as the space before it makes a string that WILL display
Adrian Fox

Brian

Adrian,

Try this, worked perfectly for me:

CONTROL about,@BUTTON,"\xFF",120,122,60,20,0x50000000,7

or as a Sysbutton:

CONTROL about,@SYSBUTTON,"\xFF",120,122,60,20,0x50010000,7

Brian

AdrianFox

Brian,

CONTROL French,@BUTTON,"\xFF",395,477,34,25,0,BUTTON28 'still produces a blank button for me.

BUT CONTROL French,@BUTTON," \xFF",395,477,34,25,0,BUTTON28  'works fine

as indeed does CONTROL French,@BUTTON," ÿ",395,477,34,25,0,BUTTON28

It seems that inserting a space prior to the character is the solution but still not sure why.

Interestingly CONTROL French,@BUTTON,"ÿÿ",395,477,34,25,0,BUTTON28 
still produces a blank button.

No matter, having the character a teensy bit off centre in the button is no real problem, and anyway it is a character that is used so little in French anyway that I doubt it will get used that much! 

I am guessing that what happens is the program sees this character string in this context as an 'ending byte' and then ignores it.  Perhaps you might have a more informed view on why this occurs, just out of interest.

Thanks in any case for your help,

:)
Adrian Fox

Brian

Adrian,

That's odd - worked straight away for me, on XP SP3. Oh, well, when I upgrade to Win 7 Professional
shortly, it probably won't work!

Anyway, why can't you put a trailing space in, to centre the text?

Brian

AdrianFox

I'm using XP 5.1 Service Pack 2.  but it still won't show without the space. 

Yes, it suddenly dawned on me to use the trailing space too to centre the character, but it's funny how the most obvious things always escape us for longer than the more complicated solutions!

Anyway, I've finished my program short of a tweak or so.  Thanks for your thoughts and help.
Adrian Fox

grid51

I think that's the end of file symbol for older languages like c or dos maybe.