Simple checkbox problem

I have a super simple thing I need to do, but the solution eludes me. The issue is I have 16 checkboxes where each box has a value assigned and I just need to add up the values of the checked boxes only and dispay it (initially - will eventually send over BT). This is my first day looking at Mit app inventor so I have two questions.

  1. Why does this not work?
  2. Any thoughts on a better way to do this?


else if

1 Like

The elseifs are preventing the checkboxes after the first from being examined.
For this scheme to work, you need 16 independent if/then blocks, no else clauses.

Don't forget to add a set firstbyte = 0 before the first if/then, so you can reuse the code without having to restart your app.

(Juan Antonio beat me to it.)


I think for 20 seconds.


Thanks for the quick reply, it worked perfectly!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.