This isn’t a bug, per se; I’m almost certain it’s on my end. …but I didn’t know where else to file this. Hope you don’t mind.
I just recently moved my project to a new computer. Last night, it was working just fine. Today I made some changes (details below), and the game is behaving strangely. There may be more, but here’s what I noticed:
If I have a table with string indexes, and I call a specific entry using a variable holding that string index, it returns nil. Here’s some code:
[lua]local points = { set1 = 4, set2 = 3, set3 = 2, set4 = 1 }
print(card.set) – Returns string ‘set1’
print(points[‘set1’]) – Returns number 4
print(points[‘set2’]) – Returns number 3
print(points[‘set3’]) – Returns number 2
print(points[‘set4’]) – Returns number 1
print(points[card.set]) – Returns nil[/lua]
That’s not the exact code; I simplified a little to prove my point…but it serves its purpose. I can’t for the life of me understand what could possibly have happened.
Now, as I mentioned, I did change some things recently. This is a Mac. I’m using Build 498, but I doubt that matters…previous version exhibited the same behaviour. I just switched my Terminal from bash to zsh…also unrelated; switching back to bash didn’t affect anything. I also installed the latest XCode 4/iOS SDK. I thought this might have something to do with it. I downloaded it because I needed gcc for something, but I don’t think that would affect my Corona project…perhaps something else in there, though?
If you can think of anything else, let me know; I’ll try to remember what else I changed, but I don’t remember there being much more. Thanks in advance for your help; this one has me baffled. hehe [import]uid: 21712 topic_id: 9454 reply_id: 309454[/import]