| View previous topic :: View next topic |
| Author |
Message |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Oct 20, 2005 6:12 am Post subject: Table.getn() fails... |
|
|
hey guys!
got the following keyed table...
| Code: |
Startpos = {
p1={x=1,y=2},
p2={x=3,y=4}
}
|
further it try to get the data from it
| Code: |
print(Startpos.p1.x) --ok
print(Startpos.p1.y) --ok
print(Startpos.p2.x) --ok
print(Startpos.p2.y) --ok
|
which works just fine...
| Code: | | print('players: '..table.getn(Startpos)) |
but getting its size fucks up, says 0 but its definitive 2 ;)
greets
lumo _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Thu Oct 20, 2005 6:39 am Post subject: |
|
|
The answer is correct, indeed!
Named indices are not counted.
Have you read PIL, my friend? :) _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Oct 20, 2005 4:38 pm Post subject: |
|
|
hehe nope, not for that;
thanks _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
|