L0rd1:
Comparing ints should be fast, I think your method is probably OK. It doesn't look elegant but use what works first and worry about elegant later of you really need/want to.
Hello,
i need to compare 6 variables with each other, to enshure that all 6 have different values at the same time.
for example my simple(but not the best) way to do this:
do you know better way to compare regarding CPU power ?
if (a!=b || a!=c || a!=d || a!=e || a!=f || c!=b || d!=b || e!=b || f!=b || d!=c || ....... ) { will do something when any variable is different... }
- "regarding CPU power" Don't optimize without testing first. Is that statement REALLY a bottle neck?
if(a!=b) if(a!=c) if(a!=d) if(a!=e) if(a!=f) // Mq4 doesn't have short circuit test with && if(b!=c) if(b!=d) if(b!=e) if(b!=f) // https://www.mql5.com/en/forum/139109 if(c!=d) if(c!=e) if(c!=f) if(d!=e) if(d!=f) if(e!=f) { do something when all variables are different... }
thanks guys for fast replys !
WHRoeder you have right, "or" was wrong. All vars must be different, so i have to use "and".

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
i need to compare 6 variables with each other, to enshure that all 6 have different values at the same time.
for example my simple(but not the best) way to do this:
do you know better way to compare regarding CPU power ?
thanx
L0rd