missing ")"

Elias Y. Daoud shared this question 1 week ago
Answered

The stupid compiler, saying that my expression in JavaScript has a missing ")".

Using JavaScript (On click tab).

X1 and Y1 have values and already declared. ggb is ggbApplet

When I put // (as it is a comment), no error generated. So the error is on the line

ggb.evalCommand("ggb.DynamicCoordinates("Pnt",X1,Y1)");

or ggb.evalCommand("ggb.DynamicCoordinates(Pnt,X1,Y1)");

and so many possibilities, all has " missing ")" after arguments "

Where no parenthese is missing.

Comments (7)

photo
1

ggb.evalCommand("ggb.DynamicCoordinates("Pnt",X1,Y1)");

or ggb.evalCommand("ggb.DynamicCoordinates(Pnt,X1,Y1)");

What's your problem? If you use opening brackets you have to put closing brackets too.

In both lines there are two opening brackets and just one closing one...

photo
1

have you tried ggb.evalCommand("DynamicCoordinates("+Pnt+",X1,Y1)"); ? being Pnt a text


or ggb.evalCommand("DynamicCoordinates(Pnt,X1,Y1)")


ggb.Dynamic...<---> ggbApplet.dynamic.... but dynamic.... is not a JS command

brackets are OK, I think

PD: no creo que el compilador se sienta ofendido por llamarle estupido, pero tampoco veo la necesidad de hacerlo

photo
1

Sure both don't work. I tried a lot.

Also ggb.showLable("P"+String(ti),false); don't work. and I tried many other possibilities. and I know the consept.

But such ggb.evalCommand("P"+String(ti)+"="+"("+X2+","+Y2+")");

ggb.setPointSize("P"+String(ti),1); they work

photo
1

repeat

you wrote ggb.evalCommand("ggb.DynamicCoordinates(Pnt,X1,Y1)");

i think ggb.evalCommand("DynamicCoordinates(Pnt,X1,Y1)"); is OK

Also


Also ggb.showLable("P"+String(ti),false); don't work

Lable vs Label. the rigth spelling is important

Aunque no siendo inglés me suelo equivocar

photo
1

Please post your .ggb file

photo
1

Hello, I cannot now because it is complicated.

Some features worked where others not

I know that evalCommand(...) use as passing a string command to Geogebra. even that, in some functions work and others not.

I don't know why they mix in capital and lower case charactere. SetValue in Geogebra and setValue in JS.

why () and [] can both work in a workable composition.

Geogebra is still weak in JS and need improvement. Besides that the editor in web browser has lot of bugs even in the main Geogebra editor. Where the Desktop App is lightly stable or less bugs. but still need lot of enhancement.

Thanks

photo
1

I cannot now because it is complicated.

Sorry, we can't help unless you do

Comments have been locked on this page!

© 2020 International GeoGebra Institute