I don't know how, but my code worked

First of all, here's my code:

Now, I don't know how my code is working and my confusions are-

  1. My function get_component_info, it is returning the value dictionary or the local component_type ?

also, here's the .aia file: Math_reminder.aia (921.6 KB)

What I am really trying to do is that I am giving the ability to buttons to toggle on/off their respected switch components defined in the dictionary learn.

So what's your exact doubt ??? that you made a code yourself & don't know how it works :clap: ?

My function get_component_info , it is returning the value dictionary or the local component_type ?

This is my doubt :point_up:

Check with labels

your function is returning the component_type local variable.
The local variable is determinate by dictionary after doing the code on the do block.

Just because something works does not make it right.
It has to be simple enough to prove that it is right.

Here is my simplification ...
when any Button Click global IMPOSSIBLE

Math_reminder_ABg.aia (920.2 KB)

The notAlreadyHandled test for button clicks is necessary to allow you to add a separate Click event block for the bottom button, which must be handled differently from the shape buttons.

Can you please tell the functionality of notAlreadyHandled in simple terms ?

I am sorry for late response

It makes it possible to mix generic and non-generic event handlers.

How do you plan to handle that 4th button of yours?
It is not associated with a switch.
It needs its own Click event.

What happens if you click that 4th button without its own Click event block?
Try it.

Thanks, I understood

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