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 AttributesName
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_gettop flu_gettop proc~create_1darray_real->proc~flu_gettop proc~flu_createtable flu_createtable proc~create_1darray_real->proc~flu_createtable interface~flu_pushinteger flu_pushinteger proc~create_1darray_real->interface~flu_pushinteger proc~flu_settable flu_settable proc~create_1darray_real->proc~flu_settable interface~flu_pushnumber flu_pushnumber proc~create_1darray_real->interface~flu_pushnumber interface~lua_gettop lua_gettop proc~flu_gettop->interface~lua_gettop interface~lua_createtable lua_createtable proc~flu_createtable->interface~lua_createtable proc~flu_pushint flu_pushint interface~flu_pushinteger->proc~flu_pushint proc~flu_pushlong flu_pushlong interface~flu_pushinteger->proc~flu_pushlong interface~lua_settable lua_settable proc~flu_settable->interface~lua_settable proc~flu_pushdouble flu_pushdouble interface~flu_pushnumber->proc~flu_pushdouble proc~flu_pushreal flu_pushreal interface~flu_pushnumber->proc~flu_pushreal interface~lua_pushnumber lua_pushnumber proc~flu_pushdouble->interface~lua_pushnumber interface~lua_pushinteger lua_pushinteger proc~flu_pushint->interface~lua_pushinteger proc~flu_pushreal->interface~lua_pushnumber proc~flu_pushlong->interface~lua_pushinteger

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 proc~aot_fun_put_extdouble_v aot_fun_put_extdouble_v proc~aot_fun_put_extdouble_v->interface~aot_table_from_1darray proc~aot_fun_put_quadruple_v aot_fun_put_quadruple_v proc~aot_fun_put_quadruple_v->interface~aot_table_from_1darray proc~aot_fun_put_double_v aot_fun_put_double_v proc~aot_fun_put_double_v->interface~aot_table_from_1darray proc~aot_fun_put_single_v aot_fun_put_single_v proc~aot_fun_put_single_v->interface~aot_table_from_1darray interface~aot_fun_put~3 aot_fun_put interface~aot_fun_put~3->proc~aot_fun_put_quadruple_v interface~aot_fun_put~2 aot_fun_put interface~aot_fun_put~2->proc~aot_fun_put_extdouble_v interface~aot_fun_put aot_fun_put interface~aot_fun_put->proc~aot_fun_put_double_v interface~aot_fun_put->proc~aot_fun_put_single_v

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