gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dcstringfprintf.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine dcstringfprintf (unit, fmt, i, r, d, l, n, c1, c2, c3, ca)
 書式変換出力 (装置番号版)

Function/Subroutine Documentation

◆ dcstringfprintf()

subroutine dcstringfprintf ( integer, intent(in), optional unit,
character(*), intent(in) fmt,
integer, dimension(:), intent(in), optional i,
real(sp), dimension(:), intent(in), optional r,
real(dp), dimension(:), intent(in), optional d,
logical, dimension(:), intent(in), optional l,
integer, dimension(:), intent(in), optional n,
character(*), intent(in), optional c1,
character(*), intent(in), optional c2,
character(*), intent(in), optional c3,
character(*), dimension(:), intent(in), optional ca )

書式変換出力 (装置番号版)

Author
Yasuhiro MORIKAWA, Eizi TOYODA

C の sprintf(3) のように文字列をフォーマットして装置番号に出力します。 ただし、実装は C の sprintf(3) とは大分違うのでご注意ください。

書式変換して装置番号に出力

フォーマット文字列 fmt に従って変換された文字列を 装置番号 unit に出力します。unit を省略する場合には標準出力に出力します。 fmt には '' で始まる指示子を含む文字列を与えます。 '' を出力したい場合は '%' と記述します。 指示子および用例に関しての詳細は dcstringsprintf.f90 を参照ください。

Parameters
[in]unit出力先の装置番号 (デフォルト: 標準出力)
[in]fmt指示子を含むフォーマット文字列
[in]id, o, x 用の整数配列データ
[in]rr 用の単精度実数配列データ
[in]df 用の倍精度実数配列データ
[in]Lb, y 用の論理配列データ
[in]n%* 用の繰り返し回数
[in]c1c 用の1番目の文字列
[in]c2c 用の2番目の文字列
[in]c3c 用の3番目の文字列
[in]caa 用の文字配列

Definition at line 67 of file dcstringfprintf.f90.

68
69 use dc_types, only: string, dp,sp
70 use dc_string, only: printf
71 implicit none
72 integer, intent(in), optional:: unit
73 character(*), intent(in):: fmt
74 integer, intent(in), optional:: i(:), n(:)
75 real(SP), intent(in), optional:: r(:)
76 real(DP), intent(in), optional:: d(:)
77 logical, intent(in), optional:: L(:)
78 character(*), intent(in), optional:: c1, c2, c3
79 character(*), intent(in), optional:: ca(:)
80 character(STRING):: buf
81 continue
82 call printf(buf, fmt, i=i, r=r, d=d, l=l, n=n, &
83 & c1=c1, c2=c2, c3=c3, ca=ca)
84 if (present(unit)) then
85 write(unit, '(A)') trim(buf)
86 else
87 write(*, '(A)') trim(buf)
88 endif
文字型変数の操作
Definition dc_string.f90:83
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92
integer, parameter, public sp
単精度実数型変数
Definition dc_types.f90:82

References dc_types::dp, dc_types::sp, and dc_types::string.