Discussing the article: "Everything you need to learn about the MQL5 program structure"

 

Check out the new article: Everything you need to learn about the MQL5 program structure.

Any Program in any programming language has a specific structure. In this article, you will learn essential parts of the MQL5 program structure by understanding the programming basics of every part of the MQL5 program structure that can be very helpful when creating our MQL5 trading system or trading tool that can be executable in the MetaTrader 5.

In this part, we will learn about the preprocessor in detail as a programming concept. The preprocessor is a crucial step in the compilation process. It occurs before the actual compilation of a program. During the preprocessing step, various actions are performed, such as including files, determining software properties, defining constants, and importing functions.


All preprocessor directives start with (#).  These directives are not considered language statements. As a result, they should not be ended with a semicolon (;). Including a semicolon at the end of a preprocessor directive can lead to errors based on the type of directive.

In other words, we can say that the preprocessor is meant to preparation of the program source code before the process of compilation. There are many types of preprocessor directives based on parameters that we need to determine in the MQL5 program the same as the following:

  • Macro substitution (#define)
  • Program Properties (#property)
  • Including Files (#include)
  • Importing Functions (#import)
  • Conditional Compilation (#ifdef, #ifndef, #else, #endif)

Author: Mohamed Abdelmaaboud

Reason: