//Convertir un conjunto de objetos Puntos Libres [br]//a un objeto Lista de Puntos y borrar los Puntos Libres[br]//en JavaScript[br][br] var no = ggbApplet.getObjectNumber();[br][br] var xV, yV;[br] var j = 1;[br] /////////////////////////////////////////////// [br] // Enlista el nombre de los objetos del mismo tipo en un arreglo [br] ggbApplet.evalCommand("LxV={ }");[br] ggbApplet.evalCommand("LyV={ }");[br] for (var i = 0; i < no; i++) {[br] if (ggbApplet.getObjectType(ggbApplet.getObjectName(i)) == "point") {[br] ggbApplet.evalCommand("xV=x(" + ggbApplet.getObjectName(i) + ")");[br] ggbApplet.evalCommand("yV=y(" + ggbApplet.getObjectName(i) + ")");[br] xV = ggbApplet.getValue("xV");[br] yV = ggbApplet.getValue("yV");[br] //alert(i + " xV=" + xV + " yV=" + yV);[br] ggbApplet.setListValue("LxV", j, xV);[br] ggbApplet.setListValue("LyV", j, yV);[br] j++;[br] } // si[br] } // para[br] ggbApplet.evalCommand("LP=Sequence((Element(LxV,i),Element(LyV,i)),i,1,Length(LxV),1)");[br] ggbApplet.evalCommand("index=Sequence(IndexOf(Element(Sort(LxV),i),LxV),i,1,Length(LxV),1)");[br] ggbApplet.evalCommand("LP2=Sequence(Element(LP,Element(index,i)),i,1,Length(LP),1)");[br] ggbApplet.setVisible("LP", false);[br] ggbApplet.setVisible("LP2", true);[br] ggbApplet.deleteObject("xV");[br] ggbApplet.deleteObject("yV");[br] var opt = prompt("Deseas borrar las coordenadas de los puntos? (Y/N)", "N");[br] var dno=no;[br] if (opt == 'Y' || opt == 'y') {[br] for (var i = dno; 0<i ; i--) {[br] if (ggbApplet.getObjectType(ggbApplet.getObjectName(i)) == "point") {[br] ggbApplet.deleteObject(ggbApplet.getObjectName(i));[br] //dno--;[br] } // si[br] } // para[br] } //if opt