I found something interesting using the 'when' block

  1. Make a variable called current value
  2. Build this code:
    when green flag is clicked
    store 0 to variable [current value]
    
    when (call (
      wait 1 second
      change variable [current value] by 1
      say (current value)
      print <false>
    ) using)
    
  3. The sprite counts endlessly.
Other programming languages

In AverageStudentSnappedBASIC:

global
  current_value = 0
  function checker()
    wait 1
    current_value += 1
    say current_value
    return false
  end function
end global
sprite
  sub handle_start()
    current_value = 0
  end sub
  assign_handler("when_green_flag_clicked", handle_start)
  sub when(condition)
  end sub
  assign_handler("when", when, checker)
end sprite


is not exactly the same as

which is what your BASIC code does.

Your experiment is interesting; I’m just saying your “other programming languages” code isn’t exactly equivalent.

You can get the behavior you want by right clicking the when block, selecting relabel, and then selecting when <> :: condition

Is there a reason you couldn't use blocks over a textual version of Snap! you imagined up? Just curious.

@mobility212

For who want the scripts: