i have this 8 question survey in my mobile application handover project. At first the corona did not prompt me any error message and the app works just fine but when i add 2 more question to it i start getting this message error Corona Runtime Error “attempt to concatenate field ‘?’ (a nil value)” and it is from line 662 and 678.
this is my code from line 662-678
function checkEBASComplete()
local tempScore = 0
for i = 1, 10 do
print(“EBAS:”…ebasRating_Arr[i])
tempScore = tempScore + ebasRating_Arr[i]
if (ebasRating_Arr[i] == -1) then
ebasScore = 0
ebasScore_text.text = “Test Incomplete”
else
ebasScore = tempScore
ebasScore_text.text = tostring(ebasScore)
end
since that’s the concatenation you’re doing. ebasRating_Arr[] may have nil’s in it. I would suggest not doing a concatenate in the print, but instead, do:
print("EBAS:", ebasRating\_Arr[i], i)
That way you can see which values are nil and then you can figure out from there why they are nil.
i now i get a slight different error. instead of attempt to concatenate field ‘?’ i get something like " attempt to concatenate field ‘EBAS_ID’ (a nil value) on lua:713"
the ? have change to EBAS_ID and here are the code
Please, you must use code formatting when posting code here. It’s the blue <> button in the row with Bold, Italic, etc. Click that button and paste your code into the window that pops up or type in
[code]
paste your code in then
[/code]
No one is going to look at that jumbled up code and make any sense of it.
i now i get a slight different error. instead of attempt to concatenate field ‘?’ i get something like " attempt to concatenate field ‘EBAS_ID’ (a nil value) on lua:713"
the ? have change to EBAS_ID and here are the code
since that’s the concatenation you’re doing. ebasRating_Arr[] may have nil’s in it. I would suggest not doing a concatenate in the print, but instead, do:
print("EBAS:", ebasRating\_Arr[i], i)
That way you can see which values are nil and then you can figure out from there why they are nil.
i now i get a slight different error. instead of attempt to concatenate field ‘?’ i get something like " attempt to concatenate field ‘EBAS_ID’ (a nil value) on lua:713"
the ? have change to EBAS_ID and here are the code
Please, you must use code formatting when posting code here. It’s the blue <> button in the row with Bold, Italic, etc. Click that button and paste your code into the window that pops up or type in
[code]
paste your code in then
[/code]
No one is going to look at that jumbled up code and make any sense of it.
i now i get a slight different error. instead of attempt to concatenate field ‘?’ i get something like " attempt to concatenate field ‘EBAS_ID’ (a nil value) on lua:713"
the ? have change to EBAS_ID and here are the code