A character constant is the binary value of a specific ASCII character. Character constants are used as a convenient way of refering to characters without looking up the binary value of the required character. Using character constants has a distinct advantage over using the binary value directly. In particular the value is easier to read and verify when it is encountered in the source code.XCSB character constants are written as 0'C' (where C is the ASCII character for which the programmer requires the binary equivalent)
e.g.
Example of use in XCSB program
character
constanthex
constantdecimal
constantbinary
constant0'1' 0x31 49 0b_0011_0001 0'/' 0x2F 47 0b_0010_1111 0'A' 0x41 65 0b_0100_0001 if x >= 0'a' && x <= 0'z' then // got here if x is a lower case ASCII alpha character else if x >= 0'A' && x <= 0'Z' then // got here if x is an upper case ASCII alpha character else if x >= 0'0' && x <= 0'9' then // got here if x is a numeric ASCII digit endif