Javascript access to tables like VBA Cells(row, column)

HopfenUndMalz shared this question 4 years ago
Answered

I want to fill a geogebra table with values from javascript. Programming the cell names as "A1", "B1" etc. surely is possible but tedious.

Is there a possibility to access these cells in a in (row, column)-format like EXCEL-VBA does it? Or does someone know a short form to address table cells in a loop in the "A1", "B1" ... format?

Comments (3)

photo
1

GeoGebra has the command Cell[column, row] so you can try e.g.

ggbApplet.getValue("Cell[1,1]");

photo
1

Thank you - almost perfect. I want to setup the Table so I tried e.g.


  1. ggbApplet.setValue("Cell[2,2]",3.14);


which seems to do nothing. Why??

photo
photo
1

  1. ...Or does someone know a short form to address table cells in a loop in the "A1", "B1" ... format?...

See the Globl Javascript in the attachment.

To write the converted cell-name in the Spreadsheet: you can use the solution from Noel.


PS:

Only for Read but not for Write exist a native GGB-Command with number instead name for column.

© 2021 International GeoGebra Institute