Elif False Control Map Property

If the "elif" statement tested false, then the "Control" map remains the same. More formally,

if the following are true:
  • the line at time t = i
  • the tab at time t = j
  • statement at line i, tab j = elif test:
  • expression state at time t = "end_expr"
  • Return Value at time t = False

then Control Map at time (t + 1) = Control Map at time t

If the "elif" statement tested false, then LW Python leaves "Control" map unchanged. This means the "Control" map entry for the current tab number remains "if":False. We know that the top element is "if":False because if it was "if":True, then the "elif" test would not even be evaluated (it would be skipped).

Here is an example: if the following are true:

  • the line at time 22 = 3
  • the tab at time 22 = 0
  • statement at line 3, tab 0 = elif __eq__(7, 9):
  • expression state at time 22 = "end_expr"
  • Return Value at time 22 = False

then Control Map at time (22 + 1) = Control Map at time 22

Try stepping through the simulator to see the "Control" map remain the same after the "elif" test is evaluated.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments