dcstringcprintf.f90
Go to the documentation of this file.
1 !== Formatted output conversion
2 !
3 ! Authors:: Yasuhiro MORIKAWA, Eizi TOYODA
4 ! Version:: $Id: dcstringcprintf.f90,v 1.2 2009-03-20 09:50:19 morikawa Exp $
5 ! Tag Name:: $Name: $
6 ! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
7 ! License:: See COPYRIGHT[link:../../COPYRIGHT]
8 !
9 !== Overview
10 !
11 ! C の sprintf(3) のように文字列をフォーマットして返します。
12 ! ただし、実装は C の sprintf(3) とは大分違うのでご注意ください。
13 !
14 
15 function dcstringcprintf(fmt, i, r, d, L, n, c1, c2, c3, ca) result(result)
16  !
17  ! フォーマット文字列 fmt に従って変換された文字列を返します。
18  ! 第1引数 fmt には指示子を含む文字列を与えます。
19  ! 指示子には「<tt>%</tt>」を用います。
20  ! <tt>%</tt> を用いたい場合は 「<tt>%%</tt>」と記述します。
21  ! 指示子に関しての詳細や用例に関しては dc_utils/dcstringsprintf.f90 を参照ください。
22  !
23  use dc_types, only: string, dp
24  use dc_string, only: printf
25  implicit none
26  character(len = STRING):: result
27  character(*), intent(in):: fmt
28  integer, intent(in), optional:: i(:), n(:)
29  real, intent(in), optional:: r(:)
30  real(DP), intent(in), optional:: d(:)
31  logical, intent(in), optional:: L(:)
32  character(*), intent(in), optional:: c1, c2, c3
33  character(*), intent(in), optional:: ca(:)
34 continue
35  call printf(result, fmt, i=i, r=r, d=d, l=l, n=n, &
36  & c1=c1, c2=c2, c3=c3, ca=ca)
37 end function dcstringcprintf
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(len=string) function dcstringcprintf(fmt, i, r, d, L, n, c1, c2, c3, ca)
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118