If I have a class named ‘team’ and a public member function of that class as below, why can I not pass a string to it as a parameter? The string is always received in the function as ‘nil’. (However, passing in numbers works fine!!? :S)
I’m using http://www.coronalabs.com/blog/2011/09/29/tutorial-modular-classes-in-corona/ as my guide to classes (and have set everything up as detailed in there)…
[lua]function team:setName(msg)
print("MSG = " … msg) – receive an error telling me ‘msg’ is ‘nil’
end[/lua]
Here’s the code for calling the function from a ‘main.lua’ file
[lua]local team = require(“team”)
local team1 = team.new(“no name”)
team1.setName(“Red Team”)[/lua]
Thanks for the help!!!.. [import]uid: 134465 topic_id: 29920 reply_id: 329920[/import]