Count the entries in a lua table.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L |
Handle for the Lua script. |
|||
integer, | intent(in) | :: | thandle |
Handle of the table to count the enries in. |
Returns the number of entries in the table.
function aot_table_length(L, thandle) result(length) type(flu_state) :: L !! Handle for the Lua script. !> Handle of the table to count the enries in. integer, intent(in) :: thandle !> Returns the number of entries in the table. integer :: length length = 0 if (aot_table_first(L, thandle)) then do length = length + 1 call flu_pop(L) if (.not. flu_next(L, thandle)) exit end do end if end function aot_table_length