Method calls

Syntax

variableName.methodName(arguments)

where:

Description

You can call a method defined on the variable's type using this syntax:
myVariable.myMethod(arguments)

This expression returns the evaluation result of the method. If there is no such method, then an error will result when MQL tries to evaluate the expression, and the evaluation process is aborted.

Where possible, for features defined in a metamodel for example, we recommend to use properties in place of method calls, as it makes the code simpler and more readable:
myClass.namespace.name may sounds nicer than myClass.getNamespace().getName().

This syntax is used to call a non-static public method on an object. Note that MQL allows to call static methods on a specific class.

Examples

// gets the name of the class and call the toUpperCase method() on it
myClass.name.toUpperCase()

// calls the isAbstract() method on the class
myClass.isAbstract()