|
|||||||
| 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 (2) | Thread Tools | Display Modes |
|
||||
|
Hi there!
Welcome to my third lesson in my MQL4 course. I hope you enjoyed the “SYNTAX” lesson, which tried to give you the answers for: • What format you can use to write MQL4 code? • How to make the world better by commenting your code? • What the Identifiers are, and what are the rules of choosing them? • What are the MQL4 Reserved words? If you didn’t read the “SYNTAX” lesson please download it from here: http://forex-tsd.com/attachment.php?attachmentid=399 And you can download the “Welcome” lesson from here: http://forex-tsd.com/attachment.php?attachmentid=372 Don’t forget to login first. Now, let’s enjoy the DATA TYPES. ----------------------------------------- Download the lesson to know more. Last edited by forexts : 11-07-2005 at 08:36 AM. |
|
|||
|
You described that we should write a null character after the last character of data in data type string.
But it was nothing in the examples: string str1 = "Hello"; So no null. May be it was for the explanation only? Last edited by newdigital : 10-30-2005 at 04:11 PM. |
|
|||
|
An other question.
double should be between 2.2e-308 to 1.8e308. What is e? Is it in hexadecimal format? And an other question. I know that somebody uses the letters before name of variables, for example: int nSomeNumber = 12345; bool bIsRightPlace = true; double fCurrentPrice = 1.2344; datetime tCurrentDate = D'2005.02.02. 8;00'; color cChartColor = Olive; string sMyName = "Joel" I mean n for int, b for bool, f for double, t for datatime, c for color and s for string. Is it still usable? |
|
||||
|
Quote:
Question 1: 2.2e-308 and1.8e308 are numbers wrote in exponential notation. Exponential notation is a way of writing large numbers without having to write out a lot of zeros, for example, 1,000,000,000 can be written as 1.0E9. The number followed the E is called the exponent and it indicates how many places the decimal point must be moved to change the number to the normal decimal notation. The exponent can be positive or negative; the exponential number 6.35E-5 is equivalent to 0.0000635 in decimal notation. Question 2: Yes, this is very a good programming practice, and it called Hungarian notation. Hungarian notation is a naming convention in programming, in which the name of a variable (or function) indicates its type or intended use. You prefixed every variable name with the first letter of the variable type, and that's what Hungarian notation mean. Last edited by newdigital : 10-30-2005 at 04:10 PM. |
|
||||
|
Quote:
Your questions enrich the course. Thanks! I've used the exponential notation in my lesson to tell you what the range of float data type is (2.2e-308 to 1.8e308), because I can't write these numbers in decimal notation. Do you imagine 307 zeros in the right of the number 18 to present the number 1.8e308. In MQL4, you can't use the exponential notation. To present the number 2.5E-4 in MQL4 you have to write it in decimal notation like this: double fCoefficient = 0.00025; Last edited by codersguru : 10-31-2005 at 12:59 AM. |
|
|||
|
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/lessons/158-lesson-3-mql4-data-types.html
|
|||
| Posted By | For | Type | Date |
| Untitled document | This thread | Refback | 03-20-2008 02:26 PM |
| Forex Indicators With Explanation - Type Your Search Here | This thread | Refback | 12-04-2007 10:20 PM |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mql4 tutorial - Where is Lesson 1, etc.? | ftsdPadawan | Metatrader 4 mql 4 - Development course | 2 | 01-15-2007 08:36 PM |
| Lesson 4 - MQL4 Operations & Expressions | codersguru | Lessons | 28 | 12-20-2006 07:25 AM |
| Lesson 8 - Variables in MQL4 | codersguru | Lessons | 11 | 09-15-2006 01:06 PM |
| Lesson 17 - Your First Script | codersguru | Metatrader 4 mql 4 - Development course | 0 | 01-04-2006 11:37 PM |
| Lesson 7 - Functions | codersguru | Lessons | 2 | 11-02-2005 03:32 PM |