danielinhu
Technical User
- Jun 22, 2010
- 23
Hello people,
I already have been here, and i already solved my first problem.
Now I already can read a file from outside fortran in fortran.
But now I want to add a new line in my list how can i do it??
my program is:
....
select case(opcao)
case(1) ! This first option open the file with the data
write(*,*) "Numero do Mineral | Nome | Cor | Brilho | Dureza "
open (2, file="basedados.txt", iostat = ok, status='old') ! Abre a lista de minerais
if (ok == 0) then
do n=1, 10
read (2, *, iostat=fim_fich)basedados
if (fim_fich < 0) exit
basemineral = basemineral +1
end do
close(2)
else
write(*,*) "erro na aberura do ficheiro:",ok
end if
print "(i5,2x,a11,2x,a10,2x,a10,2x,f6.1)",basedados
case(2) ! In case 2 I want to add a new mineral to my database
...
how can i do it??
Can someone help me??
Greetings
I already have been here, and i already solved my first problem.
Now I already can read a file from outside fortran in fortran.
But now I want to add a new line in my list how can i do it??
my program is:
....
select case(opcao)
case(1) ! This first option open the file with the data
write(*,*) "Numero do Mineral | Nome | Cor | Brilho | Dureza "
open (2, file="basedados.txt", iostat = ok, status='old') ! Abre a lista de minerais
if (ok == 0) then
do n=1, 10
read (2, *, iostat=fim_fich)basedados
if (fim_fich < 0) exit
basemineral = basemineral +1
end do
close(2)
else
write(*,*) "erro na aberura do ficheiro:",ok
end if
print "(i5,2x,a11,2x,a10,2x,a10,2x,f6.1)",basedados
case(2) ! In case 2 I want to add a new mineral to my database
...
how can i do it??
Can someone help me??
Greetings