Hello world/Line printer: Difference between revisions

m
Line 343:
The page-throw was actually a "skip to control column 1"; that is, the lineprinter has an associated paper tape in a loop with holes punched in certain columns of the tape and the tape would be advanced one position for each line advance. The length of the loop matches the number of lines to a page of printout, or was twice that number, etc. A hole in column one of the loop would be aligned (by the human operator during setup) with the top-of-form paper position and when a carriage control of "1" was acted on, the lineprinter would skip forwards until the "1" hole was detected. A carriage control character of "2" would thus skip onwards until a hole in column two was detected - and if there was no such hole, the skip wouldn't stop until the human operator noticed. Thus, many control tapes had all columns punched across, not just one. However, this ability was more properly used in producing vast outputs with subsections to a page suitably marked by suitable holes. The benefit was firstly that the printer skipped to a hole mark more rapidly than via a sequence of "advance one" or "advance two" commands, and secondly, the program did not need to generate such sequences nor have then saved via output spooling. But all relied on the right output being matched to the right tape. This was more typical at COBOL installations.
 
It is because of the first character disappearing as carriage control that the "list" style output (as in <code>WRITE (6,*) "Hello World!"</code>) always starts a line of output with a space. This form does not require a FORMAT statement.
 
Since for a new job, output would commence with the lineprinter already at the top of a new page, an overprint (no carriage advance) thus means writing to the very first line. If however, top-of-page placement was not assured at your installation, then "1HELLO WORLD!" would do.
<lang Fortran> WRITE (6,1)
WRITE (6,1)
1 FORMAT ("+HELLO WORLD!")
END </lang>
</lang>
 
=={{header|FreeBASIC}}==
1,220

edits