# passing value from GG to JS

János Losonczi shared this question 2 years ago

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

1

Hi, try :

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


1

Thank you, it works well.

JL