stdlib_optval:local:
:depth: 2
optval - fallback value for optional argumentsExperimental
Returns x if it is present, otherwise default.
This function is intended to be called in a procedure with one or more optional arguments, in order to conveniently fall back to a default value if an optional argument is not present.
result = optval (x, default)
x: Shall be of type integer, real, complex, or logical, or a scalar of type character.
default: Shall have the same type, kind, and rank as x.
If x is present, the result is x, otherwise the result is default.
{literalinclude} ../../example/optval/example_optval.f90
:language: fortran