Chr() vs ChrW() and Const ...

J

Joe Duchtel

Hello -

I was wondering why I can do a ...
Public Const A As Char = Chr(36)
.... but not a ...
Public Const B As Char = Chr(165)?

It seems like 0-127 are okay with the Chr(). Is this because values >
127 depend on the currently active code page and hence are dynamic?

I also had a case where a Chr(146) would match a character in a string
but a ChrW(146) would not. I would expect both of these calls to
return the same character. Could the reason be how I compare
strings? I think I used the equal operator instead of .Equals().

How do the Chr() and ChrW() functions work differently?

Thanks,
Joe
 
M

Martin H.

Hello Joe,

if you move the cursor to Chr or ChrW and press F1 you will find the
online help on your screen which covers exactly that subject (in the
"Remarks" section).

Best regards,

Martin


Am 13.05.2008 22:07, schrieb Joe Duchtel:
 
J

Joe Duchtel

Hello -

I tried the Chr,ChrW Functions Visual Basic Language Reference and was
just a little bit confused. I guess I just have to mull it a little
more ...

Thanks!
Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top