Loading from Json : Getting nil when # is stored

I’m using Rob’s easy save and load in JSON.

I have a table set up as  myData.settings = {} with sub levels: 

myData.settings.levels = {}

myData.settings.levels[1] = {}

  

 in myData.settings.levels[1] I have

myData.settings.levels[1].score and myData.settings.levels[1].stars

in my game, I calculate the “game score” and then I want to compare it to the previously stored score for that level.  The problem I’m having is even when I have a score that is not nil or 0, I’m not able to load the stored score from my table.  I get an error:  Attempt to compare number with nil.

I know the number is in the table because I can visibly see it in my Project Sandbox.

How do I load a number stored in the table to then compare it to my calculated game score?

I appreciate any help - I’ve tried as many options as I can think of.

Thanks

Lori

I’m no expert but maybe the problem is using number indexed table/array then key indexed???

have you tried myData.settings.levels[1][1] & myData.settings.levels[1][2]

T.

Thanks.  I’ll give that a try.

If that doesn’t solve your problem, can you copy and paste the relevant portion of the JSON file that gives you the error?

I’m no expert but maybe the problem is using number indexed table/array then key indexed???

have you tried myData.settings.levels[1][1] & myData.settings.levels[1][2]

T.

Thanks.  I’ll give that a try.

If that doesn’t solve your problem, can you copy and paste the relevant portion of the JSON file that gives you the error?