The Inquire Statement
At any time during the execution of a program it is possible to inquire about the status and attributes of a file using this statement. Using a variant of this statement, it is similarly possible to determine the status of a unit, for instance whether the unit number exists for that system Another variant permits an inquiry about the length of an output list when used to write an unformatted record.
For inquire by unit:
inquire (unit=u, ilist)or for inquire by file:
inquire (file=fln, ilist)or for inquire by I/O list:
inquire (iolength=length) olistAs an example:
logical :: ex, op character (len=11) :: nam, acc, seq, frm integer :: irec, nr inquire (unit=2, exist=ex, opened=op, name=nam, access=acc, sequential=seq, form=frm, & recl=irec, nextrec=nr)yields
ex .true. op .true. nam cities acc DIRECT seq NO frm UNFORMATTED irec 100 nr 1(assuming no intervening read or write operations).
Other specifiers are iostat, opened, number, named, formatted, position, action, read, write, readwrite.
Read more about this topic: Fortran 95 Language Features, Operations On External Files
Famous quotes containing the words inquire and/or statement:
“I wish more and more that health were studied half as much as disease is. Why, with all the endowment of research against cancer is no study made of those who are free from cancer? Why not inquire what foods they eat, what habits of body and mind they cultivate? And why never study animals in health and natural surroundings? why always sickened and in an environment of strangeness and artificiality?”
—Sarah N. Cleghorn (19761959)
“Truth is used to vitalize a statement rather than devitalize it. Truth implies more than a simple statement of fact. I dont have any whisky, may be a fact but it is not a truth.”
—William Burroughs (b. 1914)