Download MetaTrader 5
To add comments, please log in or register
Use the Pocket to paste your content. It is convenient!
Carl Schreiber
5959
Carl Schreiber 2014.07.23 12:32 

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 2014.07.23 13:55  

Would the following work for you?

#define BELL CharToStr(7)

Carl Schreiber
5959
Carl Schreiber 2014.07.23 21:25  
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
13641
whroeder1 2014.07.26 11:52  
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