| View previous topic :: View next topic |
| Author |
Message |
Ratchet
Joined: 19 Jul 2006 Posts: 10
|
Posted: Thu May 10, 2007 3:21 am Post subject: Attempt to call a table value |
|
|
If I run following code with Lua 5.1.1 I got the message "attempt to call a table value":
| Code: | selcols={"col1", "col2"}
for key,col in selcols do
print(col)
end
|
What's wrong here? |
|
| Back to top |
|
 |
lhf
Joined: 20 Feb 2006 Posts: 175 Location: Rio de Janeiro, Brazil
|
Posted: Thu May 10, 2007 5:23 am Post subject: |
|
|
| This is obsolete syntax. Use "for key,col in pairs(selcols)". |
|
| Back to top |
|
 |
Ratchet
Joined: 19 Jul 2006 Posts: 10
|
Posted: Thu May 10, 2007 5:51 am Post subject: |
|
|
| Thx! |
|
| Back to top |
|
 |
|