Hi,
I have this pickerwheel:
local smallIX = {} for i=1, 99 do smallIX[i] = i end local columnData = { { align = "center", width = 25, labels = smallIX, startIndex = operateBy } } pickerWheel = widget.newPickerWheel({ id = "factorSelect", font = "Helvetica-Bold", left = centerX - 28, top = centerY + 80, overlayFrameHeight = 150, overlayFrameWidth = 0, columns = columnData })
The object itself is declared as local at the top of my prefs scene, the only global is the value ‘operateBy’ which is set to 1 in the main file. The program enters the first scene where operateBy is used with its starting value of 1. Switching to the prefs scene there’s the picker wheel which is supposed to allow selecting a new value for operateBy, which is also the value for the startIndex of the pickerwheel.
If I switch in between the two scenes without changing ‘operateBy’ with the pickerwheel no errors occur, but if I change the value and exit the prefs scene, where the pickerwheel is, and get back to it I get returned the general error ‘attemping to index ? field’ with a reference to the line where the pickerwheel is created… the prefs scene gets destroyed and then reloaded when called.
It’s as if the code is unable to associate the global variable to the startIndex value when modified.
Any idea on why this happens?
Thanks a lot.