How to toggle A,B,C with one button

Hi guys, I’m trying to figure this out.

Each time the button is clicked, it toggles between three values, “A”, “B”, and C”. with one button

I get that I have to use if else statement… but I feel like I’m stucked.

If Button1.Text = ‘A’
then set Button1.Text to ‘B’
elseif Button1.Text = ‘B’
then set Button1.Text to ‘C’
elseif Button1.Text = ‘C’
then set Button1.Text to ‘A’
end else

Another approach without using if-then-else:

On initialize:
TinyDB.store A -> B
TinyDB.store B -> C
TinyDB.store C -> A

Button.onClick:
Button.setText: TinyDB.GetValue(Button.Text)

HI, Thank you for your response!
I just tried it and it doesn’t execute.
Do I need something before if blocks to start with text A?
Thank you!

The solution is the withdrawn post :slight_smile:

now updated to @ABG's answer
Taifun

1 Like

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