Scor­pio News


January–March 1987, Volume 1, Issue 1

Page 16 of 63

where u is the physical or logical unit number, £ {8 the # dated FORMAT statement and kis. list of variabl ‘although it is optionally possible to use the form:


where Li is the label of the statement to which control is passed in the event of an I/O ERROR and L2 the ent Label ‘to which control {s passed Lf an END OF FILE is encountered. These are extensions of data I/O not found in the 1966 standard)

The Logical Unie Numbers referr

to above are normally asrigned as follows:

Unite 1, 3, 4 and $ are assigned to the console/VDU; Unit 2 Le assigned to the printer ‘Units 6 – 10 are assigned to disk files. Units 11 – 235 may be Bseigned as the user wishes (and units 1-10 may sito be re-assigned if you really vant tol)

For most purposes the default assignments will be found adequate but for further information, the appropriate reference manual ust be consulted

‘A typical READ statement will Look Like

READ(S.35) Rob 35 FORHAT(I3,2%,14)

An which two data entries, K and L are read in from the keyboard with field widths of 3 and 4 respectively, separated by a blank field of 2 spaces. The Seme holds for a WRITE statement since, if it is in the same program subroutine,

WRITE(2,35) KL.

will cause the values of K and L to be output on the printer, starting in column Yland separated by 2 spaces Statement numbers muse not be duplicated in the game sutcoutine but more than one READ/WRITE statement may reference & given FORMAT statement

Alphanumeric text material (letters, symbols and figures) may be used as progr: I/O by means of a FORMAT statement in one of two ways which employ Hollerith field descriptors the first (and less convenient) method involves the Programmer. in countang the exect number of characters and spaces to be input oF Durput = tedious for ong tities, while the other simply involves placing the entire text between single quotes {") | In both cases, che program statement Bust not run beyond column 72, if » longer text string {s needed, then a Continuation line if used, The statements




are treated in the same vay by the compiler but the first uses the Hollerith (H) field width desceipror – 20 unite wide in this cage ond the game as the text including spaces while the second uses single quotes as text delimiters – a lot easler to use!” The expressions mean “write to # disk file the text followed by the current value of the variable L’

fon both input and output, text can be split between Lines by using the solidu (iy “as far ag input ie concerned, this applies to disk input data files 4 well as to punched cards or paper tape – both of which are unlikely input media For the average micro user. The firet example given above could be rewritten

This is an OCR’d version of the scanned page and likely contains recognition errors.

Page 16 of 63