Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Fortran Programming Language

line input


Hello,

In Visual Basic there is this command <<Line Input>>  which reads a
full line from an ASCII file and stores it in a string variable.

Is there anything similar in Fortran? I would like to read a comments
line (that includes spaces).
I know I could parse it but this is such a pain (unless somebody has a
parsing routine).
Please advice.

Thanks

Tuli

Hi,

On Mar 2, 7:10 pm, "tuli" <tuli.herscov@gmail.com> wrote:

> In Visual Basic there is this command <<Line Input>>  which reads a
> full line from an ASCII file and stores it in a string variable.

The following should work:

character(len=256) :: str
integer :: myFile = 5
  ! open file etc.
read(myFile,'(a)') str

Note: If you replace the '(a)' by *, only one word is read.

Tobias

Hi,

On Mar 2, 7:14 pm, "Tobias Burnus" <bur@net-b.de> wrote:

> integer :: myFile = 5

And of cause 5 is a bad choice for a file unit as it is on most
systems the INPUT_UNIT (0 is usually the ERROR_UNIT, 6 the
OUTPUT_UNIT).

Tobias

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc