Examples of using User-defined function in English and their translations into Russian
{-}
-
Official
-
Colloquial
Example: user-defined function in a program.
The basic code contains a user-defined function call.
The user-defined function Lot() is a small example used for these purposes.
Previously considered implementation of user-defined function Gipo.
Before to call a user-defined function, you should describe it first.
On executing this operator, the program will first call the user-defined function.
In this user-defined function, all calculations are collected in one operator.
Let us consider some implementation versions of the above user-defined function.
On executing the user-defined function, the program takes the following steps.
The include file Check.mqh containing the description of the user-defined function Check.
User-defined function Criterion() is connected using the directive include.
The circles in the diagram mark function calls for the standard and the user-defined function.
In referring to the user-defined function, the program will perform the following steps.
In the EA newbar.mq4 the algorithm of detecting a new bar is implemented in the form of a user-defined function.
The user-defined function is first called from the special function init.
In order to create graphical objects, the user-defined function Create()(blocks 10-11) is used in the program.
The user-defined function Errors() shown in this section processes errors using the selection operator switch.
Let us consider how the same calculations are made in the program containing a user-defined function in Figure 19.
In this example, the user-defined function puts out a message with trading recommendations.
Calculations regarding the detection of a new bar are concentrated in the user-defined function Fun_New_Bar.
But if the operation fails, the user-defined function for processing errors Fun_Error() is called block 10-11.
The names of variables in the basic text of the program have no relations to the names of formal parameters in a user-defined function.
An example of one more user-defined function that helps to organize the output of text information about the current work of an EA.
In the right part of the diagram,the connecting arrows are shown that symbolize the possibility to call one user-defined function from another.
The section considers an example of user-defined function Terminal() that is realized in a separate include file with the extension. mqh.
If the current time is more than orequal to the value of Time_Cls specified by user, then the Executor() user-defined function will be called for execution.
Briefly, a user-defined function has a description, and a function call is used for starting its execution in a program.
In the header of the operator'for', we specify the call to the user-defined function Func_yes_ret() that can return one of two values: 1 or 5.
For calculating stop levels the user-defined function New_Stop() is used; as a passed parameter the stop level value set by a user is used.
This is why, after having displayed the message, the program calls to the previously considered user-defined function Create(), which results in a new creation of the object in the symbol window.