This is a follow up to my get_command_argument() question.
I'm reading a command line argument (arg
) into a Fortran program. Then I want to store the value of arg
as an integer. ichar()
doesn't do the job.
This seems kind of basic, so clearly I'm doing something wrong. Any hints?
program test_get_command_argument
integer :: i,j
character(len=32) :: arg
i = 0
do
call get_command_argument(i,arg)
if (LEN_TRIM(arg) == 0) EXIT
write (*,*) trim(arg)
i = i + 1
end do
j = ichar(arg)
end program