I want to set 0, 20 checkboxes

I want to reset 20 checkboxes to 0.

Yeah, I have 20 checkboxes in a program, and I’d like them all to be reset when I select all 20.

With the help of AI, I’ve gotten to this point, but I don’t know how to continue. I’ve entered a loop with no way out.

Can you help me?

1 Like

i have checked your pic…you are almost done its better if you use english in pic…

if checkbox on{
if variable ≠ 20 {
increment++
} else {
uncheckll all with for each item
loop
}
}

1 Like

This code will reset text to 0 when all the 5 selected, if deselect then it will count howany selected. But do know what will you do with this logic? Many ways you can achieve it and this is one among them

1 Like

Hi

If you use DynamicComponents extension ([F/OS] - Dynamic Components Extension (for every component) 2.3.0), here is another solution with downloadable blocks. This way you can change how many checkboxes you need. Of course, you can manually make the blocks in Designer and do similar, but you will need to make a large list with all the components manually as others have shown.

List of dynamic components variable (this would have to be large list of all manual components alternatively as mentioned):
checked_blocks0

A method block to streamline getting the dynamic component blocks:

Some blocks to create 20 checkboxes and add them to the dynamic components list variable made earlier. I have also made a quick way to set 19 checkboxes to true for quick checking here:

This is the method block to check if all checkbox components are true, if that is the case will return true, otherwise false.

This is the event block which checks any checkboxes for changes and if every checkbox is true, then if true, sets all back to false. This has been tested to work.

This is just how they all look together. Of course anything can be customized as you need:

Here is an aia:
CheckBoxesExample.aia (38.2 KB)

Edit1:
I realize that there is a request to literally set text of the textbox to 0 besides resetting all (misunderstood due to different language).

I have made some minor adjustments to the blocks.

In my update, there is no global variable for count, here is a method that keeps track of the checkboxes and text:

I have added to set to 0 here too once the 20/20 checkboxes is met:

I’ve just added some convenience blocks here at the bottom to set everything to test easy, they are not required.

Updated aia:
CheckBoxesExampleUpdate1.aia (39.1 KB)

1 Like

Thank you very much! I’ve already solved it, although in a somewhat sketchy way. I’m new to this.
Sorry for the language; I don’t speak English well.

1 Like

Do not use components like this. Try procedure or simple logic