aot_get_val Interface

public interface aot_get_val

Get a value from a table.

First the given key is looked up, if this fails, the value at the given position is looked up, and if this also fails, the default value is returned. Positional addressing is only valid, as long, as no value was provided by an explicit key in the list before the entry in question.

The interface to access table values looks like: call aot_get_val(val, errCode, L, thandle, key, pos, default). Position pos and key are both optional, but one of them has to be provided. If both are provided the key takes precedence over the pos, and the pos will only be tried if the access to the key fails. See for example get_table_real() for a more detailed description of the parameters.

Note that positional addressing only works intuitively as long as there have been no entries specified by keys in the table. This kind of resembles the behavior of Fortran interfaces with named or unnamed arguments, as soon as you provide a name, all following arguments have to be given by key also. Just stick to this rule for the Lua tables as well to avoid too much headache.

The reason for this is, that positional addressing in Lua refers only to the unnamed entries of the tables.


interface~~aot_get_val~7~~CallsGraph interface~aot_get_val~7 aot_get_val proc~get_table_extdouble get_table_extdouble interface~aot_get_val~7->proc~get_table_extdouble proc~flu_getglobal flu_getglobal proc~get_table_extdouble->proc~flu_getglobal proc~aot_table_push aot_table_push proc~get_table_extdouble->proc~aot_table_push interface~aot_top_get_val~3 aot_top_get_val proc~get_table_extdouble->interface~aot_top_get_val~3 interface~lua_getglobal lua_getglobal proc~flu_getglobal->interface~lua_getglobal proc~aot_table_push->proc~flu_getglobal proc~flu_gettable flu_gettable proc~aot_table_push->proc~flu_gettable proc~flu_pushnil flu_pushnil proc~aot_table_push->proc~flu_pushnil proc~flu_getfield flu_getfield proc~aot_table_push->proc~flu_getfield proc~flu_type flu_type proc~aot_table_push->proc~flu_type proc~flu_pop flu_pop proc~aot_table_push->proc~flu_pop interface~flu_pushinteger flu_pushinteger proc~aot_table_push->interface~flu_pushinteger proc~aot_top_get_extdouble aot_top_get_extdouble interface~aot_top_get_val~3->proc~aot_top_get_extdouble interface~lua_gettable lua_gettable proc~flu_gettable->interface~lua_gettable interface~lua_pushnil lua_pushnil proc~flu_pushnil->interface~lua_pushnil interface~lua_getfield lua_getfield proc~flu_getfield->interface~lua_getfield proc~aot_top_get_extdouble->proc~flu_pop proc~flu_isnumber flu_isnumber proc~aot_top_get_extdouble->proc~flu_isnumber proc~flu_todouble flu_todouble proc~aot_top_get_extdouble->proc~flu_todouble flu_isnoneornil flu_isnoneornil proc~aot_top_get_extdouble->flu_isnoneornil interface~lua_type lua_type proc~flu_type->interface~lua_type interface~lua_settop lua_settop proc~flu_pop->interface~lua_settop proc~flu_pushint flu_pushint interface~flu_pushinteger->proc~flu_pushint proc~flu_pushlong flu_pushlong interface~flu_pushinteger->proc~flu_pushlong lua_isnumber lua_isnumber proc~flu_isnumber->lua_isnumber interface~lua_pushinteger lua_pushinteger proc~flu_pushint->interface~lua_pushinteger interface~lua_tonumberx lua_tonumberx proc~flu_todouble->interface~lua_tonumberx proc~flu_pushlong->interface~lua_pushinteger


Module Procedures

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

Retrieve a extdouble precision real value from a table.

Read more…


real(kind=xdble_k), intent(out) :: val

Value of the table entry if it exists.

integer, intent(out) :: ErrCode

Error code to indicate what kind of problem might have occured.

type(flu_State) :: L
integer, intent(in), optional :: thandle

Handle to the table to look the value up in.

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

Name of the entry to look for.

Key and pos are both optional, however at least one of them has to be supplied. The key takes precedence over the pos if both are given.

integer, intent(in), optional :: pos

Position of the entry to look for in the table.

It allows the access to unnamed arrays in the Lua tables.

real(kind=xdble_k), intent(in), optional :: default

Some default value, that should be used, if the variable is not set in the Lua script.