Receive program stop error when too many numbers are generated

Hi, I do not know, but when I use the following blocks, the numbers above 1 to 1000 can be said to stop the program. Please help.

What is your Prime_number and what is your Last_number when the app crashes?

I mean the first number and the last number

Yes, what are they ?

Sorry I did not understand what you mean
That is, if the user enters the first number, for example, 1 and the last number, 1 million, the system hangs. I do not want to give an error

Not quite sure what you are expecting the app to do when presented with 1 million processes :slight_smile: it is going to take some time or overload the memory of the device. After 10 minutes my emulator was still processing (or crashed...) - I gave up waiting.

Is it realistic to want to put 1 million numbers in a label ?

What are you trying to achieve ?

1 Like

I want the user to generate a number as much as he likes out of curiosity, I put this in my program, please help us

have you ever calculated how long / digits in the string?

Yes, up to 4 digits, that is, 1000, if it is more than this, it will join the regiment

Well curiosity killed the cat or in this case, the app.

I suggest you introduce a procedure to your blocks to break up the numbers into blocks of @ 10,000 (so just generate 10,000 at a time). This takes @ 4 seconds on my emulator. Then join them all together at the end.

Also use a variable to compile the text list of numbers, then display in the label at the end.

image

I'm sorry, it counts fast, but when I hit 4 digits above ...