quick syntax question

I'm pretty noob, working with ice but I'm sure this is a general Lua syntax issue, can someone tell me why this works:

1
2
3
travel = ice:loadBox( "travel" )
travel:storeIfNew( "_G.text1Var", "2 Nights in Cancun!" )
print (travel:retrieve( "_G.text1Var" ) )

In line 4 you are trying to call a function on a string variable, I assume you wanted to do something like this:

1
2
3
_G.catVar = ice:loadBox( "travel" )
_G.catVar:storeIfNew( "_G.text1Var", "2 Nights in Cancun!" )
print (_G.catVar:retrieve( "_G.text1Var" ) )
views:1589 update:2012/2/9 11:37:26
corona forums © 2003-2011