1 ! Like char_result_5.f90, but the function arguments are pointers to scalars.
3 pure
function select (selector
, iftrue
, iffalse
)
4 logical, intent (in
) :: selector
5 integer, intent (in
) :: iftrue
, iffalse
19 pure
function select (selector
, iftrue
, iffalse
)
20 logical, intent (in
) :: selector
21 integer, intent (in
) :: iftrue
, iffalse
27 integer :: left
, right
31 integer, pointer :: ip
35 logical, pointer :: lp
37 complex, pointer :: cp
38 character, target
:: ch
39 character, pointer :: chp
40 type (pair
), target
:: p
41 type (pair
), pointer :: pp
58 call test (f1 (ip
), 200)
59 call test (f2 (rp
), 100)
60 call test (f3 (lp
), 50)
61 call test (f4 (cp
), 10)
62 call test (f5 (chp
), 11)
63 call test (f6 (pp
), 145)
67 character (len
= abs (i
) * 2) :: f1
73 character (len
= floor (r
) * 2) :: f2
79 character (len
= select (l
, 50, 55)) :: f3
85 character (len
= int (c
)) :: f4
90 character, pointer :: c
91 character (len
= scan ('123456789', c
) + 10) :: f5
96 type (pair
), pointer :: p
98 character (len
= sum ((/ p
%left
, p
%right
, (i
, i
= 1, 10) /))) :: f6
102 subroutine test (string
, length
)
103 character (len
= *) :: string
104 integer, intent (in
) :: length
105 if (len (string
) .ne
. length
) call abort