Skip to content

Extra surfaces created when exchanging files between Unix and Windows

Question

When I exchange OSLO lens files between Unix and Windows platforms (I sometimes run OSLO on Unix, using Windows emulation software), I notice that my optical prescription has many air spaces between the surfaces of my original design. What is going on? How do I stop this?

Synopsis

Extra surfaces created when exchanging files between Unix and Windows

Symptoms

Note that OSLO's lens files are created using a simple ASCII text format. When creating an ASCII text file on some platforms, the start of a new line of text is defined using a carriage return character [CR]. On other platforms, both [CR] and [LF] (line feed) characters are used. Depending on the platform, [LF] characters are interpreted the same as [CR] characters. Therefore it is possible that a [CR] on one platform is translated to [CR][CR] on another. If this happens, a blank line of text will be inserted between every line of "real" text in the prescription file. In an OSLO prescription, every blank line is interpreted as a "create a new surface" designation. As you can understand, this can lead to many "blank" surfaces being inserted into the OSLO prescription unintentionally.

Solution

Open the OSLO lens prescription file using an ASCII text editor and delete all blank lines in the optical prescription. There should be no blank lines within the data portion of the files. There can be blank lines at the bottom of the file after the "end" statement - these blank lines will not make a difference. If you like, you can perform a "Search and Replace" on the text of the lens file which replaces all double carriage characters with a single carriage return character.