| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Quote:
You have in your pocket 10$ ok? int your_pocket = 10; Then I gave you 5$ ok? int i_gave = 5; You putted the 5$ which I gave to you in your pocket, How much in your pocket now and how to collect them? your_pocket(now) = your_pocket(before I gave you the 5$) + i_gave (5$ which I gave them to you) your_pcoket=your_pocket+i_gave; //which is 15$ You can write the above expression like this: your_pocket+=i_gave; //which is 15$ So, the purpose of this operator is to increase your_pocket with the amount i_gave you and assign them again to your_pocket(or update your_pocket or put them back to your_pocket). Is it clearer now? Now, I want my 5$ back ![]() Quote:
A == B; means: You asking MQL4 is A equal to B and MQL4 has to answer you with True or False (yes or no). |
|
||||
|
Quote:
I hope you enjoy them Last edited by codersguru; 11-02-2005 at 12:06 PM. |
|
||||
|
Quote:
To view all the lessons' threads, choose a long period (EX: Last year) in display options. |
|
|||
|
It is arithmetical operations but it is logic.
In arithmetic if A + B so it should be C already. It should not be the same A (the same value). Because if we are increasing A on B assigning the result to A so A will be increasing on B all the time. Every second A will be increasing on B without any stopping. It means A plus B is equal A (the same A?) so plus B once again (because of A plus B) is equal A (an other A) which should be added to B and so on. May be during the coding everything will be clear. This is often very confusing for first time programmers. Note that the "=" and the "==" are used very differently. "=" is called the assignment operator because it causes the expression on the right hand side to be assigned to the variable on the left hand side. There is no infinite loop as you suggest. The expression A=A+B; means: take the current value of the variable A and add it to the current value of the variable B. Then place the result of the addition into variable A. So, after the expression is executed, the value of variable A will change. For example, if A equaled 2 and B equaled 3 than after executing A=A+B (or the equivalent A+=B) A would have the value 5 assigned to it. But I have a question. In Relational operators A == Bi; It means true if A equal B else false. Is it necessary to have i after B? I think you may have mistakent the semi-colon for an "i". You are correct in your definition of this logical expression except for the inclusion of the extra character "i" the relation A==B is true if A equals B and false otherwise. I hope this helps. |
|
|||
|
Hi coders !!!
I am studying from very begin. I am testing every operator because of training Could you explain how "+-" operator works ? I tryed but it makes error in compiling. Could you give me a simple, sample code with that operator.Thnx ! passass |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lesson 3 - MQL4 Data types | codersguru | Lessons | 20 | 05-18-2007 03:55 AM |
| mql4 tutorial - Where is Lesson 1, etc.? | ftsdPadawan | Metatrader 4 mql 4 - Development course | 2 | 01-15-2007 08:36 PM |
| Lesson 8 - Variables in MQL4 | codersguru | Lessons | 11 | 09-15-2006 01:06 PM |
| Lesson 9 - Preprocessors | codersguru | Lessons | 7 | 05-18-2006 08:26 PM |
| Lesson 7 - Functions | codersguru | Lessons | 2 | 11-02-2005 03:32 PM |