| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| what does it do? (Idiot question) https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=280 |
Page 1 of 1 |
| Author: | ironrick [ Sat Jan 21, 2012 1:44 am ] |
| Post subject: | what does it do? (Idiot question) |
I am teaching myself mql by looking through code examples from this forum and looking up the bits I don't understand. Wish me luck. Question: in the following code example, Code: Select all I now it seems a really small thing but I can't figure out what is being represented by ++. I know what the code sample does as a whole but... Does it simply mean increment by 1? Thanks in advance! Rick |
|
| Author: | garyfritz [ Sat Jan 21, 2012 2:17 am ] |
| Post subject: | Re: what does it do? (Idiot question) |
That originally came from C, back in the early 70's. I'll spare you the history of why they thought that was necessary in a "high-level" language, but anyway, it is an incrementor. In C and C++, but apparently NOT in MQL, you can use it before OR after a variable. When used before a variable, it increments the value and returns the incremented value. When used after, it returns the value and then increments it. For example, fake code: Code: Select all -- does the same thing, except obviously it decrements instead of incrementing. So "var++;" is exactly equivalent to saying "var = var + 1;". |
|
| Author: | ironrick [ Sat Jan 21, 2012 2:45 am ] |
| Post subject: | Re: what does it do? (Idiot question) |
Thanks! just what I needed! R |
|
| Author: | gaheitman [ Sat Jan 21, 2012 2:16 pm ] |
| Post subject: | Re: what does it do? (Idiot question) |
Relevant articles: http://docs.mql4.com/basis/operations/math and http://docs.mql4.com/basis/operations/assign Funny, the URL should be "basics" not "basis". George |
|
| Author: | ironrick [ Mon Jan 23, 2012 5:56 am ] |
| Post subject: | Re: what does it do? (Idiot question) |
Awesome George! Thanks very much! BTW, it is your MillerScore indi that I am trying to understand so that I can keep the work going there. Thanks for all you do! R |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|