create_1Darray_double Subroutine

private subroutine create_1Darray_double(L, thandle, val)

This subroutine takes a one dimensional array, and puts it as a table into the Lua context.

The returned thandle provides the index to access this newly created table.

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: L
integer, intent(out) :: thandle

Handle to access the newly created table.

real(kind=double_k), intent(in) :: val(:)

Values to put into the new table.


Calls

proc~~create_1darray_double~~CallsGraph proc~create_1darray_double create_1Darray_double interface~flu_pushinteger flu_pushinteger proc~create_1darray_double->interface~flu_pushinteger interface~flu_pushnumber flu_pushnumber proc~create_1darray_double->interface~flu_pushnumber proc~flu_createtable flu_createtable proc~create_1darray_double->proc~flu_createtable proc~flu_gettop flu_gettop proc~create_1darray_double->proc~flu_gettop proc~flu_settable flu_settable proc~create_1darray_double->proc~flu_settable proc~flu_pushint flu_pushint interface~flu_pushinteger->proc~flu_pushint proc~flu_pushlong flu_pushlong interface~flu_pushinteger->proc~flu_pushlong proc~flu_pushdouble flu_pushdouble interface~flu_pushnumber->proc~flu_pushdouble proc~flu_pushreal flu_pushreal interface~flu_pushnumber->proc~flu_pushreal interface~lua_createtable lua_createtable proc~flu_createtable->interface~lua_createtable interface~lua_gettop lua_gettop proc~flu_gettop->interface~lua_gettop interface~lua_settable lua_settable proc~flu_settable->interface~lua_settable interface~lua_pushnumber lua_pushnumber proc~flu_pushdouble->interface~lua_pushnumber interface~lua_pushinteger lua_pushinteger proc~flu_pushint->interface~lua_pushinteger proc~flu_pushlong->interface~lua_pushinteger proc~flu_pushreal->interface~lua_pushnumber

Called by

proc~~create_1darray_double~~CalledByGraph proc~create_1darray_double create_1Darray_double interface~aot_table_from_1darray aot_table_from_1Darray interface~aot_table_from_1darray->proc~create_1darray_double

Source Code

  subroutine create_1Darray_double(L, thandle, val)
    type(flu_State) :: L !< Handle to the Lua script.

    !> Handle to access the newly created table.
    integer, intent(out) :: thandle

    !> Values to put into the new table.
    real(kind=double_k), intent(in) :: val(:)

    integer :: tab
    integer :: nvals
    integer :: i

    nVals = size(val)
    call flu_createtable(L, nVals, 0)
    thandle = flu_gettop(L)
    tab = thandle

    do i=1,nVals
      call flu_pushInteger(L, i)
      call flu_pushNumber(L, val(i))
      call flu_settable(L, tab)
    end do

  end subroutine create_1Darray_double