Back Button - Block shortening

Hello everyone.
First, I want to apologize for my English.
Some time ago I became interested in Kodular. I read a lot and learn slowly.
I decided to make an application that will help me in my work - a calculator that will count the amount of material I need depending on the efficiency.
In the application, I have 30 box text, into which I will enter the data appropriately. I created a “BACK” button, which I will be able to undo the entered value in case of a mistake.

I want one “BACK” button to work for me in the currently active box.
The “Text_Box_Obl_BET_XYZ” box shows me the active Text box in which I am currently entering data.
The picture shows blocks from 1 to 12, where ultimately there will be 30!

Please help me create a shorter block.

This is what my finished “BACK” button looks like.

I would like someone to help me simplify it with the example from the first photo. Then I will do it myself on my ready button.

Thanks for the help in advance!

Make into a global list of all the text box
And try to use any text box componet which is in any component category

I’ve done something like this before, but it doesn’t work.
I get error: Segment: Lenght is negative (-1)

Text_Box_Obl_BET_XYZ gives me the correct result (number) of the textbox in which I am currently typing the data

That’s what I was up to.

In the global list you have used text box text but i told you to use text box component,

Again , hey It is simple man, use one global variable to get index of text box text is changed…


When any text box is changed

Set global index to index is in the list thing (get component) list (lista_pol)

In the procedure block

Set textbox text component (select list item list (get lista_pol) index (get global index))

To (further fill up the books based on then )

1 Like

I have tried like this and found got working

1 Like

I did this:
And it works too.

I will try what you gave.

Thank you so much for help !!!

Good to see. Also if you use local variable you can still reduce your block…

Of course I will try your last solution.
Thank you very much again!

1 Like

Forget to say , try to use if the length of the text is greater than 1, i miss to add,…, if not if length is 0 then it will throw an error…

Also i used back pressed… but you are using separate button it seems. They just mingle the suggested blocks with your design… :+1:

1 Like

Yes, I used my own button.

1 Like

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