List of Lists problem
It is day 3 for me and I am making progress but have looked at a number of posts about lists of lists but can’t see exactly how the examples work and how I would store and retrieve and update the data.
I am wanting to store a series of four pairs of X,Y coordinates from three sensors. Basically, an array “Sensor_List[3][4][2]” The data being supplied by a Bluetooth connection so no typing into text boxes or presenting in text boxes.
I have the Bluetooth bit working fine as I am already plotting results on the canvas. As far as I can tell the initialisation of ‘Sensor_List’ is correct as it looks like this.
[[[0,0],[0,0],[0,0],[0,0]],[[ 0,0],[0,0],[0,0],[0,0]],[[ 0,0],[0,0],[0,0],[0,0]],[[ 0,0],[0,0],[0,0],[0,0]]]
However, I keep getting errors
Runtime Error
The operation add items to list cannot accept the arguments: , [0], [0], [0]
Note: You will not see another error reported for 5 seconds
You will see that I have debug label text just before the add items to the list to check that I am not trying to use zero values as list indexes
You will also see that ‘Store_Plot’ has write/read function controlled by “Insert” flag. The code in the ‘else’ is there hoping that the ‘write’ worked and I could test to see if I could get data out. It is disabled for now just in case it contributed to the problem.
My questions please
- What is the problem with the failed write to the list?
- What would be the smart way to extract the X,Y pairs.?