Could you please tell why the Asc() function returns incorrect result?
Dim TestChar = Chr(128)
Dim CharInt = Asc(TestChar) ' this is a mistake on Windows 7 x64. Asc(TestChar) returns 136 instead of 128
I executed this code on another computer and the result was 128.
Thanks.
Your computer is using a different default code page.
The Asc
function uses the system's current ANSI code page.
The Chr
function simply casts the value to char
. (Unless it's > 255
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With