sysdeparg.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

integer function sysdepargcount ()
 
subroutine sysdepargget (idx_given, result)
 

Function/Subroutine Documentation

◆ sysdepargcount()

integer function sysdepargcount ( )

Definition at line 35 of file sysdeparg.f90.

Referenced by dc_args::buildargtable(), and sysdepargget().

35  !
36  ! この手続きは, コマンドライン引数の数を返します.
37  ! F95 以前の処理系では Fortran90/95 規格外の <b>IARGC()</b>
38  ! 関数により実装され, F2003 に対応する処理系では
39  ! COMMAND_ARGUMENT_COUNT 関数によって実装されます.
40  !
41  ! Get the number of commandline arguments.
42  ! In F95, it is implemented by nonstandard built-in
43  ! function <b>IARGC()</b>.
44  ! In F2003, it is implemented by standard built-in
45  ! function <b>COMMAND_ARGUMENT_COUNT()</b>.
46  !
47  implicit none
48  !
49  ! Selected by Makefile using Ruby
50  !
51  result = command_argument_count()
Here is the caller graph for this function:

◆ sysdepargget()

subroutine sysdepargget ( integer, intent(in)  idx_given,
character(len = *), intent(out)  result 
)

Definition at line 55 of file sysdeparg.f90.

References sysdepargcount().

Referenced by dc_args::buildargtable().

55  !
56  ! この手続きはコマンドライン引数のうち、*index* (*idx_given*)
57  ! 番目の値を *value* (*result*) に返します。
58  !
59  ! *index* が引数の数よりも大きい場合、*value* には空文字
60  ! が返ります。*index* が負の場合には、後方からの順番になります。
61  ! すなわち、-1 ならば最後の引数が返ります。
62  !
63  ! ほとんどの処理系では Fortran90/95 規格外の <b>GETARGC()</b>
64  ! 関数により実装されます。
65  !
66  ! gets the *index*th (*idx_given*th) commandline argument
67  ! to *value* (*result*).
68  !
69  ! If *index* is more than the number of arguments,
70  ! *value* will be filled with blank.
71  ! If *index* is negative, *index*th argument in reverse
72  ! is return to *value*. In other words, if *index* = -1,
73  ! the last argument is returned.
74  !
75  ! Most typically, it is implemented by nonstandard built-in
76  ! subroutine <b>GETARG()</b>.
77  !
78  implicit none
79  integer, intent(in):: idx_given
80  character(len = *), intent(out):: result
81  integer:: idx
82  integer:: argc
83  interface
84  integer function sysdepargcount()
85  end function sysdepargcount
86  end interface
87 continue
88  argc = sysdepargcount()
89  if (idx_given < 0) then
90  idx = argc + 1 + idx_given
91  else
92  idx = idx_given
93  endif
94  if (idx > argc) then
95  result = ""
96  else
97  !
98  ! Selected by Makefile using Ruby
99  !
100  call get_command_argument(idx, result)
101  endif
integer function sysdepargcount()
Definition: sysdeparg.f90:35
Here is the call graph for this function:
Here is the caller graph for this function: