MULTEXT - Document MQL2. SgmlQL reference/Operators.
Functions

Definition

User functions are defined by means of the define statement. The function is defined for all subsequent queries (until it is re-defined). The arguments of the function are given by value: a function may be recurrent.

Prototype:

define function_name [ ( variable_name [ , variable_name ]* ) ] as query

Examples:

define max($a , $b) as if $a > $b then $a else $b;
define pi as 3.141592;

Utilisation

User function are called by means of their name (defined with the define operator). The optional arguments are given between parenthesis like built-in functions.

Prototype:

<function name> [ ( <arg1> [ , <argn> ]* ) ]

Examples:

  • max(12,45) + 1;
  • 46
  • global $r = 11.5;
    2 * pi * $r;
  • 72.2566




    | Top | Next | SgmlQL reference | LPL/CNRS | MULTEXT

    Copyright © Centre National de la Recherche Scientifique, 1997.