Can I somehow: #define delim 0x07 (wrong is just 7 not [uchar]7 = BEL

 

Hi,

to assign a variable a specific ASCII-Char e.g. 7 (BEL) one can do this:

        string b = CharToStr(7);

but I cannot use this function if I want to define B as Bell:

      #define B 0x07

This will be just 7 :(

Is there a way to define B as Bell using #define?

Thanks in advance

Gooly

 

Would the following work for you?

#define BELL CharToStr(7)

 
Thirteen:

Would the following work for you?


YES - Thank you!

I didn't try that because I was convinced the compiler will complain...

Gooly

 
Thirteen: Would the following work for you?.
#define BELL CharToStr(7)
But that requires a function call (per use.) Just create the character.
#define BELL '\x7' // Char not string
Reason: