create_1Darray_real Subroutine

private subroutine create_1Darray_real(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

Handle to the Lua script.

integer, intent(out) :: thandle

Handle to access the newly created table.

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

Values to put into the new table.


Calls

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

Called by

proc~~create_1darray_real~~CalledByGraph proc~create_1darray_real create_1Darray_real interface~aot_table_from_1darray aot_table_from_1Darray interface~aot_table_from_1darray->proc~create_1darray_real

Contents

Source Code


Source Code

  subroutine create_1Darray_real(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=single_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_real