I've held on to FORTRAN because of its ability to explicitly define input (and output) formats -- this is a must for extracting data from a number of publicly available datasets.

I'm now trying to convert one of my most useful programs to PASCAL, but I am hung up on how to read multiple variables from a single line.

For example, here's a FORTRAN format I need to emulate:

FORMAT(I3,I7,2X,A25,1X,F6.2,1X,F7.2,3(1X,I4),1X,F4.1,1X,I1)

On a single line, I begin with two integer variables, skip two spaces, one string variable, one space followed by a real variable, skip a space, etc.

I know of examples that involve treating each line as a character array, but I cannot find them now. I also know how to specify write formats, but have seen no examples of applying that to reading lines.

Thanks for any suggestions,

Dave

--
------------------------------------------------------
 David M. Lawrence        | Home:  (804) 559-9786
 7471 Brook Way Court     | Fax:   (804) 559-9787
 Mechanicsville, VA 23111 | Email: [email protected]
 USA                      | http:  http://fuzzo.com
------------------------------------------------------

"All drains lead to the ocean."  -- Gill, Finding Nemo

"We have met the enemy and he is us."  -- Pogo

"No trespassing
 4/17 of a haiku"  --  Richard Brautigan


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to