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.
Retrieve a quadruple precision real value from a table.
NOTE that Lua actually only provides double precision numbers, and this interface is merely a convenience for Fortran implementations with quadruple precision real numbers.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=quad_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. |
|
integer, | intent(in), | optional | :: | pos |
Position of the entry to look for in the table. |
|
real(kind=quad_k), | intent(in), | optional | :: | default |
Some default value, that should be used, if the variable is not set in the Lua script. |
Set a value in a table.
The given value will be put at the entry named by key into the table provided in thandle. Alternatively you can also put the value by position into the table by providing the pos argument. If both, pos and key are provided, the key will be used. Though, both of them are optional, at least one of them has to be provided.
Put a quadruple precision real value into a table.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=quad_k), | intent(in) | :: | val |
Value of the table entry if it exists. |
||
type(flu_State) | :: | L | ||||
integer, | intent(in) | :: | thandle |
Handle to the table to look the value up in. |
||
character(len=*), | intent(in), | optional | :: | key |
Name of the entry to look for. |
|
integer, | intent(in), | optional | :: | pos |
Position of the entry to look for in the table. |
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.
Retrieve a quadruple precision real value from a table.
NOTE that Lua actually only provides double precision numbers, and this interface is merely a convenience for Fortran implementations with quadruple precision real numbers.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=quad_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. |
|
integer, | intent(in), | optional | :: | pos |
Position of the entry to look for in the table. |
|
real(kind=quad_k), | intent(in), | optional | :: | default |
Some default value, that should be used, if the variable is not set in the Lua script. |
This interface enables the simple creation of uniform one dimensional arrays as tables in the Lua context.
It takes an one dimensional array of values and returns a thandle to identify the newly generated table.
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | ||||
integer, | intent(out) | :: | thandle |
Handle to access the newly created table. |
||
real(kind=quad_k), | intent(in) | :: | val(:) |
Values to put into the new table. |
Retrieve a quadruple precision real value from a table.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=quad_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. |
|
integer, | intent(in), | optional | :: | pos |
Position of the entry to look for in the table. |
|
real(kind=quad_k), | intent(in), | optional | :: | default |
Some default value, that should be used, if the variable is not set in the Lua script. |
Put a quadruple precision real value into a table.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=quad_k), | intent(in) | :: | val |
Value of the table entry if it exists. |
||
type(flu_State) | :: | L | ||||
integer, | intent(in) | :: | thandle |
Handle to the table to look the value up in. |
||
character(len=*), | intent(in), | optional | :: | key |
Name of the entry to look for. |
|
integer, | intent(in), | optional | :: | pos |
Position of the entry to look for in the table. |
This subroutine takes a one dimensional array, and puts it as a table into the Lua context.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | ||||
integer, | intent(out) | :: | thandle |
Handle to access the newly created table. |
||
real(kind=quad_k), | intent(in) | :: | val(:) |
Values to put into the new table. |