# Problem with Javascript (?)

VangelisFakoudis shared this question 5 months ago

Good afternoon,

I would be grateful if you could help to face the following problem:

I have developed a very heavy geogebra file that crashes after pressing a certain number of keys (20). I think that the javascript crashes. If the problem is javascript, is there a command to use in order to clear its memory?

I do not know Javascipt, so that I say, perhaps is totally wrong.

Thank you in advance

1

1

Approach one of the weights near balanza. When the lock appears, click on it. After click on it "Αποδεύσμευση". After 20 times it crash.

Sorry for my English.

Thank you.

1

Try changing

```ΜΑ_1=Ζατ
ταξηΖατ = 13
SetValue[ΛιΖατΣυν,ταξηΖατ,1]
```

to

```SetValue(ΜΑ_1,Ζατ)
SetValue(ταξηΖατ,13)
SetValue[ΛιΖατΣυν,ταξηΖατ,1]```

1

Yes, yes, yes, yes ....

Thank you very, very much.

I try to solve this mistake for months.

But the biggest mistake was that I did not ask in the Geogebra community.

I am now so happy and excited

If you ever come to Greece tell me, because I want to cook for you many souvlaki and drink with you much wine.

Vangelis Fakoudis

1

Unfortunately, he solved this problem but created another. Now it does not tie up with the point and if you put weight, the balanza scales to one side and the weight does not follow it.

1

Some of your scripts still need changing to use SetValue

```ΒΑ_3=ΒΤ_1
ταξηΒΤ_1 = 6 ```

What's the purpose of ΜΑ,Ζατ?

Also you might find it useful to use the spreadsheet to organise your objects

1

I think that don't need to change all to see if it works. I only changed the lock that appears when you approach MA in Zat. MA is the point where you move the first weight with the variable x. Zat is the left point of the yoke that appears.

If I put MA = Ζατ, then the MA is stuck in Ζατ and when the yoke is tilted because the weight is greater from one place, then the yoke follows. If you put SetValue(MA, Zat) then it only gets the current value of Zat and when it changes position, the MA don't follow it. To understand, you changed the price of x (slider) to see that weight does not change position.

What do you mean "to useful the spreadsheet to organise your objects"?

Do you understand why the file crashe when you click 20 times on the locks? (when the command is MA=Zat)

Thanks Michael.

1

```Do you understand why the file crashe when you click 20 times on the locks?

```

Sorry, it doesn't crash for me

Try defining

```MA = Element({Zat, (fill in list of all possibilities)}, choice)
```
and then you can just do

```SetValue(choice, 1)
```
or

```SetValue(choice, 2)
```
etc in the scripts. Basically it's important to avoid "=" in scripts

1

I'll try that you say. Probably it solve the problem. I will tell you.

Thank you