fdoc

subroutinedefineprivate

subroutine define(c, id, v)

Set variable id in the current scope.

Arguments

NameTypeIntentAttributesDescription
ctype(fypp_t)inout

the state

idintegerin

the name

vtype(value_t)in

the value

Calls

Source

Show the code
subroutine define(c, id, v)
    type(fypp_t), intent(inout) :: c    !! the state
    integer, intent(in) :: id           !! the name
    type(value_t), intent(in) :: v      !! the value
    integer :: k, f

    f = c%frame
    if (f == 0) then
        c%globals(id) = v
        c%is_set(id) = .true.
        return
    end if
    do k = 1, c%frames(f)%n
        if (c%frames(f)%ids(k) == id) then
            c%frames(f)%values(k) = v
            return
        end if
    end do
    call frame_room(c%frames(f))
    c%frames(f)%n = c%frames(f)%n + 1
    c%frames(f)%ids(c%frames(f)%n) = id
    c%frames(f)%values(c%frames(f)%n) = v
end subroutine define

Graphs

Calls

Called by