Pb de commande Exécute dans un script

bruno serres shared this question 3 months ago
Answered

bonjour à tous,

je souhaite faire un fichier de construction et pouvoir effacer les objet ajouté.

j'ai fait un bouton "poubelle" dans lequel le script est :

Execute[Zip["Delete[" + M + "]", M, liste]]

jusqu'à présent ce script fonctionnait.

Aujourd'hui il fonctionne en local mais pas en ligne ?

ill19_cercle_circonscrit – GeoGebra

est-ce un problème de script ?

merci,

bruno

Comments (5)

photo
1

Es erscheint mir sicherer einfach mit

Execute({“delete(“+sequence(liste(j),j,1,length(liste))+“)“})

liste abzuarbeiten? warum zip bemühen.

photo
1

If you try

testList=Zip["Delete[" + M + "]", M, liste]

then you can see there are a lot of repeated commands. I think you need to be careful about what gets added to that list.


I guess "mode" is getting added to it and then you are deleting it

photo
1

ggbApplet.setMode(0);
ggbApplet.evalCommand("mode=0");
should be

ggbApplet.setMode(0);
ggbApplet.evalCommand("SetValue(mode,0)");

photo
1

Hi haweThanks for your answer:

i think put the Delete in the sequence is better : Sequence("Delete(" + (Element(liste, i)) + ")", i, 1, Length(liste))

Hi Michael, How are you ?

You're right : in my applet downloaded , the liste is empty, but when i open my applet on line it's like if all the objects are reconized as new objects and so enter in the list.

What i don't undestand is why all the applets i made before with the same script are ok and not this one ???

do i need to put a condition on my global javascript to active the line only after the applet is open ?

function Ajouter(M) {

ggbApplet.evalCommand('SetValue[liste,Insert["' + M + '",liste,1]]');

}

thanks all,

have a nice day,

bruno

photo
1

ok i put a button to clear the list at the beginning

i think it's ok : ill19_cercle_circonscrit – GeoGebra

thanks all,

bruno

© 2021 International GeoGebra Institute