# get_table_integer_v Subroutine

## private subroutine get_table_integer_v(val, ErrCode, L, thandle, key, pos, default)

This routine obtains a vectorial quantity with fixed length from a Lua table as a whole.

It is intented to ease the reading of vectors on the Fortran side by capsulating the parsing of the Lua table internally. Components which are not found are filled with the data given in the default vector. For each component an error code will be returned to indicate the success when reading it. If the vector is not defined at all, all components will be indicated as non-existent. Components, which are neither defined in the Lua script, nor in the default will be marked with the aoterr_Fatal flag.

### Arguments

Type IntentOptional AttributesName
integer(kind=int_k), intent(out) :: val(:)

Vector read from the Lua table.

integer, intent(out) :: ErrCode(:)

Error code describing problems encountered in each of the components. This array has to have the same length as val.

type(flu_State) :: L

Handle to the lua script

integer, intent(in), optional :: thandle

Handle of the parent table

character(len=*), intent(in), optional :: key

Name of the variable (vector) to read.

integer, intent(in), optional :: pos

Position of the (vector) to read.

integer(kind=int_k), intent(in), optional :: default(:)

A default vector to use, if no proper definition is found. Components will be filled with the help of this default definition.

## Source Code

  subroutine get_table_integer_v(val, ErrCode, L, thandle, key, &
&                         pos, default)
type(flu_State) :: L !! Handle to the lua script
integer, intent(in), optional :: thandle !! Handle of the parent table

!> Vector read from the Lua table.
integer(kind=int_k), intent(out) :: val(:)

!> Error code describing problems encountered in each of the components.
!! This array has to have the same length as val.
integer, intent(out) :: ErrCode(:)

!> Name of the variable (vector) to read.
character(len=*), intent(in), optional :: key

!> Position of the (vector) to read.
integer, intent(in), optional :: pos

!> A default vector to use, if no proper definition is found.
!! Components will be filled with the help of this default definition.
integer(kind=int_k), intent(in), optional :: default(:)

integer :: toptype

toptype = aot_type_of(L       = L,       &
&                   thandle = thandle, &
&                   key     = key,     &
&                   pos     = pos      )

if (toptype /= FLU_TNONE) then
call aot_top_get_val(val, ErrCode, L, default)
else
ErrCode = ibSet(0, aoterr_NonExistent)
ErrCode = ibSet(ErrCode, aoterr_Fatal)
end if

end subroutine get_table_integer_v