Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site houxf.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxl!houxm!houxf!ho95b!wcs From: wcs@ho95b.UUCP Newsgroups: net.lang.f77 Subject: How can I get free-form input to work? Message-ID: <568@houxf.UUCP> Date: Mon, 16-Jan-84 16:06:32 EST Article-I.D.: houxf.568 Posted: Mon Jan 16 16:06:32 1984 Date-Received: Tue, 17-Jan-84 03:05:23 EST Sender: **RJE**@houxf.UUCP Organization: Bell Labs, Holmdel NJ Lines: 39 ---- I'm trying to do free-form input in f77 on 4.1BSD, and I can't get it to work. The basic structure for the input file that I want is a collection of lines, each of which describes an operation. The lines all begin with a format-identifier, but have different types of arguments after that. For example: 'file' 'file-type' 'file-name' Iarg4 Iarg5 'scale' 'x' Farg3 Farg4 Farg5 Iarg6 'scale' 'y' Farg3 Farg4 Farg5 Iarg6 'trace' Iarg2 'plot' 'quit' Unfortunately, each READ statement reads up to a newline, and discards any unused data on the line. What I wanted to do was read the first field, then do one or two more reads on the line, with the variables and their types dependent on the previous data. The best I've been able to do so far is to use list-directed input, with a separate line for each batch of stuff to be read: 'file' 'file-type' 'filename' Iarg4 Iarg5 'scale' 'x' Farg3 Farg4 Farg5 Iarg6 .... A typical READ statement is READ(5,*) XORY, LOW, HIGH, INCHES, ISEXAC I've read that UNIX F77 will treat a file as one long character stream if you open the file with RECL=1. Unfortunately, whenever I put RECL=1 in the open statement, f77 decided to use DIRECT access instead of SEQUENTIAL, and list-directed i/o only works with SEQUENTIAL. Has anyone gotten something like this to work? Thanks; Bill Stewart BTL-Holmdel NJ {.....BTL..}!ho95b!wcs ucbvax!ihnp4!ho95b!wcs decvax!harpo!ho95b!wcs