Search
 
SCRIPT & CODE EXAMPLE
 

LUA

lua len array

print(table.getn{10,2,4})          --> 3
    print(table.getn{10,2,nil})        --> 2
    print(table.getn{10,2,nil; n=3})   --> 3
    print(table.getn{n=1000})          --> 1000
    
    a = {}
    print(table.getn(a))               --> 0
    table.setn(a, 10000)
    print(table.getn(a))               --> 10000
    
    a = {n=10}
    print(table.getn(a))               --> 10
    table.setn(a, 10000)
    print(table.getn(a))               --> 10000
Comment

lua size of array

> a = {10, 11, 12, 13}
> print(#a)
4
Comment

PREVIOUS NEXT
Code Example
Lua :: print a table in lua 
Lua :: function return lua 
Lua :: how to access an index of a table lua 
Lua :: lua function 
Lua :: Tool script example for lua 
Lua :: lua push to aray 
Lua :: table in lua 
Lua :: roblox lua how to apply gravity to a object 
Lua :: svelte template vite 
Lua :: check if player is in group 
Lua :: gettable 
Lua :: exemple boolean and why it is used 
Lua :: lua how to default value if nil 
Lua :: FiveM how to check where nearest player is 
Matlab :: matlab for loop matrix 
Matlab :: matlab pause code run while simulink finishes 
Matlab :: matlab select element of matrix 
Basic :: how to send basic auth using fetch 
Basic :: how to capture link cefsharp 
Basic :: do you like messi in korean 
Elixir :: elixir timex format 
Elixir :: extract changeset error elixir 
Scala :: How to declare constant variable in scala 
Scala :: scala check if seq container true booleans 
Excel :: excel formula update insert row column 
Perl :: perl post condition 
Perl :: nested haah in perl 
Pascal :: pascal cheat sheett 
Gdscript :: GAScript - Google Sheets - QBO API - Consent Dialogue Box 
Assembly :: tqdm label 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =