passing value from GG to JS

János Losonczi shared this question 1 year ago
Answered

Hi All,

I'd like to pass the value of LenListGG (calculated in GG) to LenListJS (JS).

After many attempts the excerpt from my code is:

var LenListJS = ggbApplet.evalCommand("LenListGG = Length(G0k)");
for(var i = 1 ; i < 'LenListJS' ; i++)
The value of LenListGG is good, there is no error message, but the for loop doesn't work, I suppose because of the value of LenListJS.

Could you help?


Best regards,

JL

Comments (2)

photo
1

Hi, try :

ggbApplet.evalCommand("LenListGG = Length(l)");
var LenListJS=ggbApplet.getValue('LenListGG');
for(var i = 1 ; i < LenListJS ; i++)

photo
1

Thank you, it works well.

JL

photo
© 2019 International GeoGebra Institute