Page 1 of 1

Keyword: COND - If Statement

Posted: Thu Mar 18, 2021 11:14 pm
by YiMeng
Description
  • Performs a condition operation and returns true or false.
  • Valid operators: "==", "!=", "<=", ">=", "<", ">", "contains".
  • Invalid operator will return false.
  • Nested COND Keyword have parsing limitations and should NOT use REPEAT in TRUE clause if there is a set FALSE clause.
    • Use CONTINUE/FQUIT Keywords when there is FALSE clause for nested CONDs.
      • LOOP REPEATS 1 COND 6 == %X% ? CONTINUE && REPEATS 1 DISPMSG FALSE | SETVARI X
        REPEATS 1 DISPMSG TRUE! | FQUIT

Parameters
  • x: The value of variable 1
  • y: The value of variable 2
  • Allow the use of "+" for AND operator
  • Allow the use of "," for OR operator
  • z: The line command if the condition is true
  • w (optional): The line command if the condition is false

Usage
  • COND %x% == %y% ? z && w
  • COND %x% == %y% + %y% == %x% ? z
  • COND heystack contains needle ? z && w