The table snapDataToWrite{} in defined outside the function (it contains values entered by user).
When the “done” button is pressed, this function should run & write these table values into a file for
permanent storage.
The loop index, using the nomenclature described, #snapDataToWrite, is ZERO. Not 20 matching the
number of elements shown in the print() of the table.
Why is this happening? I don’t see any info at all on this “#” notation except one para on a getting started page that shows this. I have seen it in some examples, too. The table is populated from listeners (“tap”).
Let me know if you are aware of what is happening here or if something is not right in the code. Thanks much.
[lua]
local function buttonSnapDoneDo( event )
print( "buttonSnapDoneDo being executed . . . ")
print( "snapDataToWrite = ", snapDataToWrite )
print( "#snapDataToWrite = ", #snapDataToWrite )
– (etc)
[\lua]
"snapDataToWrite = " {userAddress1 = “e”, userAddress2 = “f”, userAutoMake = “m”, userAutoModel = “n”, userAutoTag = “o”, userCell = “k”, userCity = “g”, userCust1 = “s”, userCust2 = “t”, userEmail = “l”, userID1 = “p”, userID2 = “q”, userID3 = “r”, userName1 = “a”, userName2 = “b”, userName3 = “c”, userName4 = “f”, userPhone = “j”, userState = “h”, userZip = “i”}
"#snapDataToWrite = " 0