I'm using Fortran 90. I have a string declared as CHARACTER(20) :: Folds, which is assigned its value from a command line argument that looks like x:y:z where x, y, and z are all integers. I then need to pick out the numbers out of that string and to assign them to appropriate variables. This is how I tried doing it:
i=1
do j=1, LEN_TRIM(folds)
temp_fold=''
if (folds(j).neqv.':') then
temp_fold(j)=folds(j)
elseif (i.eq.1) then
read(temp_fold,*) FoldX
i=i+1
elseif (i.eq.2) then
read(temp_fold,*) FoldY
i=i+1
else
read(temp_fold,*) FoldZ
endif
enddo
When I compile this I get errors:
unfolder.f90(222): error #6410: This name has not been declared as an array or a function. [FOLDS]
[stud2@feynman vec2ascii]$ if (folds(j).neqv.':') then syntax error near unexpected token `j' [stud2@feynman vec2ascii]$ --------^
unfolder.f90(223): error #6410: This name has not been declared as an array or a function. [TEMP_FOLD]
[stud2@feynman vec2ascii]$ temp_fold(j)=folds(j)
syntax error near unexpected token `j'
How can I extract those numbers?