-2

I need to indicate a demarcation within a string being displayed in a grid cell.

My code currently uses Chr(144) which is a small rectangle.

This works in XP, however the symbol doesn't display in Win 7. It just doesn't display anything so Debug.Print "#" & Chr(144) & "#" will just display ##

Why doesn't the character display in Win 7?

CJ7
  • 22,579
  • 65
  • 193
  • 321
  • It's not an ASCII character, they only go from 0-127, see http://en.wikipedia.org/wiki/ASCII. – PeterJ Dec 29 '12 at 08:11
  • A square usually means the displayed font does not contain an image for the value. Chr 144 in extended ascii is not a box http://www.theasciicode.com.ar/extended-ascii-code/capital-letter-e-acute-accent-e-acute-uppercase-ascii-code-144.html – Paxic Dec 29 '12 at 08:14

1 Answers1

2

There is no ASCII character 144. ASCII only runs up to 127.
So did you mean Windows-1252 character 144? That happens to be a non-assigned character. (See character map).

So the system prints the symbol for a non-existent character, which happens to be a rectangle in the font used on your XP machine, and nothing in the font on your Win 7 machine.

To display a proper rectangle, take a look at the geometric shapes in the Unicode region U+25A0..U+25FF. U+25AF looks like it's the one you want.

Edit
I see you're using VB.Net now, so forget about ASCII and Windows-1252. VB.NET uses UTF-16 internally, so you don't have to be afraid that you can't display a certain Unicode codepoint. Just write chr(&H25AF)

Mr Lister
  • 45,515
  • 15
  • 108
  • 150