Download MetaTrader 5
To add comments, please log in or register
Freelance service: the safe way to order a trading robot. Try it!
m_shafiei2006
147
m_shafiei2006 2016.05.02 00:10 

HI


How do I write that an variable is (or not) an integer, or my integer variable does not have value ?

Keith Watford
Moderator
7862
Keith Watford 2016.05.02 00:20  

You declare a variable to what you need it to be

int a;

double b;

string c;

m_shafiei2006
147
m_shafiei2006 2016.05.02 00:29  

OK, i know


I declare

int N;

and after that as the situation changes I give a value to N, like N = 2 or N = 1 etc,

N can be 0>, 0< or 0.

but before these situations N does not have a value, I need to do something when N still does not have value.

Drazen Penic
2403
Drazen Penic 2016.05.02 00:44  
m_shafiei2006
147
m_shafiei2006 2016.05.02 01:19  
thank you again.
whroeder1
13592
whroeder1 2016.05.02 17:17  
It always has a value. If you don't give it one, it is random.
Either give it one, or add a boolean variable that states set or not.

m_shafiei2006:

N can be 0>, 0< or 0.

but before these situations N does not have a value, I need to do something when N still does not have value.

NULL is only for strings and pointers.
drazen64: Try with NULL: Void Type and NULL Constant 
m_shafiei2006
147
m_shafiei2006 2016.05.04 06:56  
WHRoeder:
It always has a value. If you don't give it one, it is random.
Either give it one, or add a boolean variable that states set or not.

m_shafiei2006:

N can be 0>, 0< or 0.

but before these situations N does not have a value, I need to do something when N still does not have value.

NULL is only for strings and pointers.
drazen64: Try with NULL: Void Type and NULL Constant 
OK, thanks, so I need to use another trick.
/
To add comments, please log in or register