Apple 310 manual End-of-Line Recognition

Page 55

C H A P T E R 2

LaserWriter Select 310 Software

End-of-Line Recognition

In PostScript interpreter versions 40.0 and later, the scanner and the readline operator recognize all three external forms of end of line (LF alone, CR alone, and CR LF pair) and treat them uniformly. The PostScript interpreter does not translate data read or written by any other means.

In the LaserWriter Select 310 printer, end-of-line (EOL) translation occurs at two levels: in the PostScript interpreter and in the serial communication channel. This section deals only with the EOL conventions at the level of the PostScript interpreter. The translation performed by the communication handler is described in Chapter 3, “Communication Channels.”

The LaserWriter 310 Select printer supports translation by the communication channel to maintain compatibility with diverse host operating systems and communications environments. For instance, always sending CR LF for EOL permits use with operating systems that treat CR alone or LF alone as EOL characters, provided they strip out the redundant character. In addition, the CR LF convention is essential for use with directly connected terminals.

The new rules for end-of-line recognition at the level of the PostScript interpreter have the following consequences.

1.Any of the three forms of EOL appearing in a string are treated as a single newline (LF) character. For example:

(any text<CR>some more text) (any text<LF>some more text) (any text<CR><LF>some more text)

The above examples produce identical string objects, each of which has a single newline (LF) character separating text and some.

2.Any three forms of EOL appearing immediate after \ in a string are treated as a continuation. This means that both the \ and the EOL are discarded:

(any text\<CR>some more text) (any text\<LF>some more text) (any text\<CR><LF>some more text)

The above examples produce identical string objects.

3.Any of the three forms of EOL appearing outside a string are treated as a single white- space character. Since the language treats multiple white-space characters in the same way as a single white-space character, the treatment of EOL is interesting only when a PostScript language token is followed by data to be read explicitly by one of the file operators:

currentfile read<cr>x currentfile read<LF>x currentfile read<CR><LF>x

The above examples produce identical results. The read operator reads the character x from the current input files and leaves its character code (an integer) on the stack.

4.The readline operator treats any of the three forms of EOL as the termination condition.

PostScript Language Changes

43

Image 55
Contents Apple LaserWriter Select 310 Printer Limited Warranty on Media and Replacement Contents Page Communication Channels Page Figures and Tables Page What This Note Contains About This NoteOther Reference Material Conventions Used in This NoteApda For More InformationPage LaserWriter Select Hardware1 LaserWriter Select 310 Hardware ROM Serial Port for RS-232C Devices Communication Ports2An 8-pin serial port connector Centronics Parallel ConnectorPstrobe Signal Status Lights ROM Capability Memory CapabilitiesBasic Operation Batch ModeDram Expansion Types Interactive ModePaper Handling 7Paper handling options Page LaserWriter Select 310 Software Adobe PostScript Programming Language Software OverviewPostScript Interpreter Types LaserWriter Select 310 DriverSelects the paper tray containing A4-size paper and sets Compatibility Operators Software ParametersProduct Strings Communication Device ParametersStatusdict Setting Compatibility Operators Device Idlefonts Setting System ParametersCheckpassword DefaulttimeoutsRamsize PrinternameProduct ProductASetpassword SetdefaulttimeoutsSetidlefonts Setprintername Setting Page Device ParametersDefaultmultipurposetraysize DefaultpapertrayPagestackorder ManualfeedtimeoutManualfeed MarginsPapersize SetdefaultmultipurposepapertraysizePapertray Setdostartpage SetdefaultpapertraySetmargins Setpagetype SetpagestackorderSetpapertray Jobname Setting User ParametersJobtimeout SetjobtimeoutWaittimeout Setting Device ParametersSetsoftwareiomode Softwareiomode Setting Communication ParametersPacketbackchannel Setpacketbackchannel SccbatchSetsccbatch Setting Engine Device ParametersDarkness Currentpacking Setting Extensions to PostScript LevelSetdarkness CurrentcacheparamsSetcacheparams PackedarraySetpacking Printer Error ParameterPostScript Language Changes PrintererrorPacked Arrays Versus Ordinary Arrays Packed ArraysCreating Packed Arrays Immediately Evaluated Names Changes in Font Cache Operation Device Resolution ImagesEnd-of-Line Recognition New Operators TrueType FontsCommunication Channels Baud Rates Serial CommunicationFlow Control Parity SettingsDTR Flow Control XON/XOFF Flow Control SCC Operator EncodingSimple Communication Protocol Communication ProtocolsBinary Communication Protocol SOH CTL-A Parallel Interface Communicating with an IBM PCDTR Flow Control for PC Communication Serial InterfaceXON/XOFF Flow Control for PC Communication Communication DynamicsStatus Queries and Spontaneous Messages Errorerror OffendingCommand operator %%