Skip Else Line Property

If the current statement is an "else" statement, and the corresponding "if" statement tested True, then increment the line by 1. 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 = else:
  • value at j in map (Control Map at time t) = pair ("if", True)

then the line at time (t + 1) = i + 1

If the "if" statement previously tested True, then the "else" statement body will be skipped. Increment the line number by 1 (but the tab number won't change).

For example, if the following are true:

  • the line at time 13 = 3
  • the tab at time 13 = 0
  • statement at line 3, tab 0 = else:
  • value at 0 in map (Control Map at time 13) = pair ("if", True)

then the line at time (13 + 1) = 3 + 1

The "Control" map indicates that the "if" test at tab 0 tested false. Try stepping through the simulator to see LW Python increment the line by 1.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments