First of all, what is CHR?
Each character has an associated ASCII value to it. To find ASCII value of a string we will simply use the function ASCII(‘A’or ‘a’….)
Below are the important values which would be handy right from SQR to Crystal Reports in several occasions:
- Character 8 - Chr(8): Backspace
- Character 9 - Chr(9): Tab (vbTab)
- Character 10 - Chr(10): Line Feed Return (vbLf)
- Character 11 - Chr(11): Shift+Enter (vbVerticalTab)
- Character 12 - Chr(12): Page Break (vbFormFeed)
- Character 13 - Chr(13): Carriage Return
- Character 14 - Chr(14): Column Break
- Character 15 - Chr(15): Shift In
- Character 32 - Chr(32): Space
These two functions can be used in any programming language(I firmly believe unless a very old crap programming language/legacy system doesn't).
For my requirement in Crystal Reports, I wrote the required IFs and FORs in Crystal Syntax and used CHRW(32), CHRW(10), CHRW(12) and CHRW(13) to meet my customization needs. Here is the link VB_Chr_Values where CHR and ASCII values are found from 1 to 255. Few of them work only with VB or behave differently with VB.
This post sounds simple even for me; however considering the time I had vetted(after forgetting) to find the required ASCII numbers to be passed in CHRW() function in Crystal and VB syntax, I think this is worth a post that could save my time in future.