! Copyright (C) GFD Dennou Club, 2000.  All rights reserved
! コマンドライン引数の取得 - gt_argtable.f90 参照

subroutine GtArgGet(ord, value, default)
    use dc_string
    use sysdep, only: SysdepArgGet
    use gt_argtable, only: BuildArgTable, argind_table, argind_count
    integer, intent(in):: ord
    type(VSTRING), intent(out):: value
    character(len = *), intent(in), optional:: default
    integer:: i
continue
    call BuildArgTable
    if (ord > argind_count) then
        value = default
    else
        i = ord
        if (ord /= 0) i = argind_table(abs(ord))
        call SysdepArgGet(i, value)
    endif
end subroutine
