How to get element count for this table?
Code:
PRF = { The function below gives me "count 0 0", I expect 1 for "Profile_1" Code:
print("count " .. table.getn(PRF) .. " " .. #PRF) |
getn only works with positive integer keys, from 1 until the sequence breaks.
If the key is another type, such as a table or string in this case, it won't count it. Lua Code:
To get the number of all keys in a table, you have to create a for loop: Lua Code:
|
T h a n k s !
|
All times are GMT -6. The time now is 07:08 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI