02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

I/O and file handling<br />

File access methods<br />

Table 8-3 summarizes the rules governing the display of each data type.<br />

Table 8-3 Format of list-directed output data<br />

Data<br />

type<br />

With the exception of character values, all output values are preceded by exactly one blank. A<br />

blank character is also inserted at the start of each record to provide ASA carriage control if<br />

the file is to be printed; see “ASA carriage control” on page 193 for a description of this. For<br />

example, the following statement:<br />

PRINT *, 'Hello, world!'<br />

outputs the line (where b indicates a blank):<br />

bHello,bworld!<br />

If the length of the values of the output items is greater than 79 characters, the current record<br />

is written and a new record started.<br />

Slashes, as value separators, and null values are not output by list-directed WRITE<br />

statements.<br />

180<br />

Output format rules<br />

Integer Output as an integer constant.<br />

Real and<br />

Double<br />

Precision<br />

Output with or without an exponent, depending on the<br />

magnitude. Also, output with field width and decimal<br />

places appropriate to maintain the precision of the data<br />

as closely as possible.<br />

Complex Output as two numeric values separated by commas and<br />

enclosed in parentheses.<br />

Logical If the value of the list element is .TRUE.,thenT is output.<br />

Otherwise, F is output.<br />

Character Output using the Alen format descriptor, where len is<br />

the length of the character expression (adjusted for<br />

doubling). If DELIM='NONE' (thedefault),nosingle(')or<br />

double (”) quotation marks are doubled, and the records<br />

may not be suitable list-directed input. If the value<br />

specified by DELIM= is not 'NONE', only the specified<br />

delimiter is doubled. Character strings are output<br />

without delimiters, making them also unsuitable for<br />

list-directed input.<br />

Chapter 8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!