GeoGebra JavaScript stops after some loops

r.hoh shared this question 3 weeks ago


I wrote a GG-Applet which two JavaScrips:

1: GG erzeugen

This Script generate a list of 2000 numbers where the number 0 ist randomly distributed according to the slider-value "a".

No problem with this part.

2. VI berechnen

This script first take a sample of 200 out of the above list and then calculates the confidence interval.

The confidence interval is visualised with a lower "U" and upper "O" point and a connecting segment.

Alltogether 100 CI´s are calculated in two nested loops.


This script runs a few times and then aborts without any error-message.

I then Have to use the task-manager to close GeoGebra.

Any idea or hint why this happens and a possible solution would be appreciated.


Comments (3)


1) have you tried using alert() to find why/where the script is getting stuck?

2) You should rework it to avoid using "=" as that reloads the whole construction each time, eg

    ggbApplet.evalCommand("U" + i + "=(" + i + "," + pu + ")")
So try and reuse objects rather than deleting/recreating them. You can use setValue() and setCoords() for this

3) Even better - avoid JavaScript and use eg Sequence()


Thanks Michael,

I´m afraid that doens´t work.

I did as you suggested (using setCoords to change the coodinates of the already existing points rather then creating new ones), but the same problem occurs.

It is somewhat strange that the script works a couple times and then it doens´t.



You still have "=" here:


Did you try (1)?

© 2020 International GeoGebra Institute