Like all languages, you have the classic statements functions.
eval <mql>
Description
Eval a MQL expression
Parameters
mql: The MQL source code - string - required
admin
eval "log trace OK!;"
mentdb
1
if <condition> <trueAction> <falseAction>
Description
IF statement
Parameters
condition: The condition - string - required
trueAction: The true action - boolean - required
falseAction: The false action - boolean - not required
admin
if (true) {
log trace OK!
} {
log trace KO!
};
mentdb
1
admin
if (true) {
log trace hello!
}
mentdb
1
if force <condition> <trueAction> <falseAction>
Description
IF statement (force true and false execution)
Parameters
condition: The condition - string - required
trueAction: The true action - boolean - required
falseAction: The false action - boolean - required
admin
if force (true) {
log trace OK!
} {
log trace KO!
};
mentdb
1
case <condition1> <action1> <conditionN> <actionN> <elseAction>
Description
CASE statement
Parameters
condition1: The condition 1 - boolean - required
action1: The action 1 - string - required
conditionN: The condition N - boolean - required
actionN: The action N - string - required
elseAction: The else action - string - not required
admin
case
(true) {A}
(false) {B}
{C}
;
mentdb
A
for <init> <condition> <increment> <action>
Description
FOR statement
Parameters
init: The init mql source code - string - required
condition: The condition - boolean - required
increment: The increment - string - required
action: The action - string - required
admin
for (-> "[i]" 0) (< [i] 45) (++ "[i]") {
log trace [i];
};
mentdb
1
while <condition> <action>
Description
WHILE statement
Parameters
condition: The condition - boolean - required
action: The action - string - required
admin
-> "[i]" 0;
while (< [i] 45) {
log trace [i];
++ "[i]";
};
mentdb
45
repeat <condition> <action>
Description
REPEAT statement
Parameters
condition: The condition - boolean - required
action: The action - string - required
admin
-> "[i]" 0;
repeat (< [i] 45) {
log trace [i];
++ "[i]";
};
mentdb
45
exception <id> <message>
Description
EXCEPTION statement
Parameters
id: The error message id - string - required
message: The error message - string - required
admin
exception (1) ("your message ...")
mentdb
1: your message ...
try <action> <errorAction> <idException>
Description
TRY statement
Parameters
action: The main action - string - required
errorAction: The error action if an error was generated - string - required
idException: The variable to save the error message - string - required
admin
try {
exception (1) ("your messffage ...");
} {
log trace [err];
} "[err]";
mentdb
1
© 2012-2017 - Jimmitry Payet.