Here's the incorrect information:
This information implies that you can only use comparison operators and && and || in /if conditions. THIS IS NOT THE CASE and incorrectly caused macro developers to use Math.Calc in /if conditions!/if (conditions) { command(s) } Runs command(s) if conditions evaluates to TRUE.
conditions are ONLY numeric compares. You must use MQ2Data string comparison to turn string compares into numeric compares.
conditions gets evaluated down to a single term from however many terms there are (You may use && and || freely.)
The correct information should read more like this:
&& || < > <= >= are mathematical operators, and can be used in anything that uses a formula, including Math.Calc, Math.Abs, etc./if (formula) { command(s) } Runs command(s) if formula evaluates to something other than 0.
formulas are ONLY numeric operations. You must use MQ2Data string comparison to turn string comparisons into numeric operations.
Additionally, the Math.Calc description says this "Performs one mathematical calculation ^ \ % + / - * != < <= == >= > && & || |" which is also incorrect. The correct information would say "Evaluates a mathematical formula".
Code: Select all
/if (${Math.Calc[1 && 2 && 3 && 4 < 5 && 12 > 100]}) {Code: Select all
/if (1 && 2 && 3 && 4 < 5 && 12 > 100) {Bottom line:
REMOVE MATH.CALC USAGE FROM /IF STATEMENTS!
