Download MetaTrader 5

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

To add comments, please log in or register
Carl Schreiber
6693
Carl Schreiber  

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

GreenMoney
379
GreenMoney  

Would the following work for you?

#define BELL CharToStr(7)

Carl Schreiber
6693
Carl Schreiber  
Thirteen:

Would the following work for you?


YES - Thank you!

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

Gooly

whroeder1
14785
whroeder1  
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
To add comments, please log in or register