copy_chars Subroutine

private subroutine copy_chars(this, to)

Arguments

Type IntentOptional AttributesName
type(fson_string), pointer:: this
character(len=*), intent(inout) :: to

Contents

Source Code


Source Code

  subroutine copy_chars(this, to)
    type(fson_string), pointer :: this
    character(len = *), intent(inout) :: to
    integer :: length

    length = min(string_length(this), len(to))

    do i = 1, length
       to(i:i) = get_char_at(this, i)
    end do

    ! pad with nothing
    do i = length + 1, len(to)
       to(i:i) = ""
    end do

  end subroutine copy_chars