Hello guys,
firts of all, I want to thank u for this great forum that is helping a lot like a programmer! :)
And my doubt is why modules are important, and what they do in a program??
Greetings
Mikrom I have a doubt.
I already have my database almost ready but i cant do a thing!
In my option 4 I want to insert a name of a mineral and delete it from the list. Can u help me with that??
There is my code:
module mineralmod
type mineral !Definicao de mineral com as suas caracterisitcas...
My program is :
You have 5 or 6 options i don't know yet! so the 1st option is to load the file with the minerals to the program.
the 2nd is to watch the file in the program
the 3rd is to insert a new mineral in the file
the 4th(and that is the one that isn't working) - is to insert a name of a...
The program is running, but my option 4 that is to delete a mineral from the database. And that isn't working 'cause I write the name to delete the mineral and that don't delete it...
I don't know if it is something with the subroutine...
there is my code again with ur help:
module mineralmod...
Sorry my option 4 still not workin! :S
I looked and I can't understand why that its happening!! Is that problem in the subroutine??
Can u help me please??
I already did what u said i think, but it continues wrong!! :s
Can u help me please???
program basedados
implicit none
type mineral !Definicao de mineral com as suas caracterisitcas
integer:: numero
character(50) :: nome,cor, brilho
real :: dureza
end type mineral
type (mineral)...
A new problem! lol
Now i want to delete a mineral from my list from the keyboard, and i created a subroutine to do it, but it give me this error:
basedados.f95:68.20:
call apagar_min(newmineral,nummineral,apagamineral)
1
Error: Rank mismatch in argument 'minerais' at...
I understood what u said about manipulating the data, but now i have a new problem!
That is really stupid!!
In my case(3) i have this:
case(3) ! Insere novo registo
write(*,*) "Introduza as caracteristicas do novo mineral - Numero, nome, cor, brilho e dureza!"
read(*,*) newmineral%...
Thanks man!! That is awesome! :)
But i didnt really understood why it didn't work with the array basedados??
And onther doubt if now i want to for manipulate the data present in the txt file, i work with the sentence like this:
newmineral&nome, newmineral%cor etc isn't it??
Greetings and...
Hey there! I think is really something like that!
But isn't working 'cause give me an error like this:
At line 48 of file basedados.f95 (unit = 5, file = 'stdin')
Fortran runtime error: Bad integer for item 2 in list input
I don't understande 'cause my 2nd item is a character and is defined...
I understood what u said, but now i saved in the file what i wrote in the program!
But i want to write in the keyboard and save it in the file.
Something like this:
case(2)
write(*,*) "Enter the mineral characteristics"
read(*,*) ( NOW I WANT TO SAVE THESE CHARACTERISTICS IN THE FILE )
Is...
open (2, file="basedados.txt", iostat = ok, status='old', access='append')
write(2,*) "Introduza numero, nome mineral etc"
read(2,*) basedados%numero, basedados%nome
close(2)
Doesn't work either! :s
appears an error like this -
At line 50 of file basedados.f95 (unit = 2, file =...
That dont work!
there is what i put:
case(2) !2-Inserir novo mineral
open(2,access='append')
write(2,*) "Introduza numero, nome mineral etc"
read(2,*) basedados%numero, basedados%nome
close(2)
That isnt working! :S
what is wrong??
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.