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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Duchtel

    #1

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

    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
  • Martin H.

    #2
    Re: Chr() vs ChrW() and Const ...

    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:
    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

    Comment

    • Joe Duchtel

      #3
      Re: Chr() vs ChrW() and Const ...

      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



      On May 13, 11:47 am, "Martin H." <hk...@gmx.netw rote:
      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:
      >
      >
      >
      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- Hide quoted text -
      >
      - Show quoted text -

      Comment

      Working...