Why does this crash?

Hello! So I am trying to make a program which will do this: while textbox3 lenght is shorter than textbox2 lenght do join textbox1 text+, to textbox3.


Edit: I fixed it. I will attach solution.

The "length" block returns a number, not text; it should be fine to use the math equal-to block.

1 Like

Ohh sorry. I forgot it.

1 Like

It shouldn't crash; all it will do is set TextBox4's text to "ab," if the length of TextBox3's text is less than or equal to length of TextBox2's text.

Also, there is no need to reset TextBox3's text.

After clicking the button the textbox3 is going to be empty 1st. Then is checking the if else condition. So in the condition textbox3 will always be empty.

what about using Do it to debug your blocks? see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

So i changed some things. it still crashes.

Try this

1 Like

Yeah that works but my task is to do that with 1 button click

Please download and post each of those event block(s)/procedures here ...
(sample video)

P.S. Things you are ignoring:

  • You left out the content of the text box you are extending from the JOIN block
  • You are expecting the textbox to change immediately. Maybe use a variable for your intermediate results, to factor out screen refresh, then update the screen after the variable is long enough?

you might want to use the textbox extension and its AfterTextChanged event

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.