I know how to do variables with subscripts in graphs and CL.
But, how do I reference lists in CL?
If I have a list named X, how could I reference the whole list in CL?
Also, how do I reference the 3rd item in the list in CL?
numbers and number lists an be referenced the same way:
number(“X”)
numberList(“X”)
you can reference an item in a list as a number:
number(“X[3]” would be the third item in list X.
I can’t sort this out. Please lend me a clue.
I’m trying to retrieve element 1 from graph list G_n to stuff it into a table. I tried many variations of these:
initialCellContent(2,1):BuildingGraph.number("${G_{n}[1]}")
initialCellContent(2,1):BuildingGraph.number("G_{n}[1]")
Now I’ve also tried the following which has errors on both lines (sorry)
numberList("M"): GalleryGraph.numberList("M")
cellContent(2,2): number(“M[1]”)
I’m not sure if that way of referring to elements in a list has been phased out since Jay’s post (I can’t get that method to work either), but if you use BuildingGraph.numberList(`G_n`).elementAt(1)
, this should do the trick.
Since a number is neither latex nor text, I believe you need to include the backticks or quotes respectively, and surround the code with ${ }
:
initialCellContent(2,1): `${BuildingGraph.number("G_{n}[1]")}`
Pretty sure it hasn’t. I use it often for correctness checking tables.
Thanks - maybe I was just encountering the same issue as you suggested, not wrapping the whole thing in quotes/backticks.