Using evalCommand to evaluate more than one command

shaihanani shared this question 3 years ago
Answered

I am trying to use one evalCommand in Glabal Java Script to execute more than one command.

the Javascript API manual sais: "From GeoGebra 3.2 you can pass multiple commands at once by separating them with \n." I tried both , and \n, like:

evalCommand("SetValue(a, true)", "SetValue(b, false)") or

evalCommand("SetValue(a, true)" \n "SetValue(b, false)").

Both are not working. I know I can use Execute with a list of commands, but is there a way to use evalCommand with multiple parameteres?

BR

Shai Hanani

Comments (2)

photo
1

I think that \n is a separator of commands

have you tried evalCommand("SetValue(a, true) \n SetValue(b, false)") ?

photo
1

Many thanks. It works. The API manual is not clear about putting the \n within the "..."

photo
© 2021 International GeoGebra Institute