Jun. 11th, 2008

netbard: (Default)
Since I was thinking of that game on the way to work today, I shall now inflict it upon all of you. Nya.

VB6

Jun. 11th, 2008 11:08 am
netbard: (Default)
Dear VB6,

I'm not sure if you were aware of this, but Unicode is a very big set of characters. The numeric representation, in fact, goes from x0000 to xFFFF. In decimal, that means it goes from 0 to 65,535. It rather needs to, as holding a spot for every character used in the world is a rather lot of characters.

Why, then, does the internal function for returning the character code of a unicode character (ascw) return an integer? Are you not aware that, in your own language, integers go from -32,768 to 32,767? And that you have a long data type that goes from -2,147,483,648 to 2,147,483,647?

Why do you cause me pain, VB6? Why do you hate me so very much?

The day I get to replace all our VB6 code with a more modern language will be a very, very happy day for me.

Update - the fix I had to do to make this work:

        if (ascw(c) > 0) then
            Response.write c & ascw(c) & "<br/>"
        else
            Response.write c & ((32769 - (ascw(c) * -1)) + 32767) & "<br/>"
        end if

Profile

netbard: (Default)
netbard

September 2025

S M T W T F S
 123456
78910111213
14151617181920
2122232425 26 27
28 29 30    

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 2nd, 2025 01:17 am
Powered by Dreamwidth Studios