newbie: nice text file

Brent Pinkney Brent.Pinkney at reuters.com
Wed May 2 17:21:32 UTC 2001



Hi,

According to Adreas Raab on 10 July 1997 in message 9707 to this list (Google is
amazing)

1. Change FileStream class>>concreteStream to return CrLfFileStream.

Now to work and save your code in a file stream, recall that all text areas in
Sqeauk can be used to excute code.

2. Using the file list create a new file, say doit.st.
3. Open the file using the file open menu. This will open a new purple window
with the contents of your file. This looks similar to a workspace.
4. Edit text, inspect, display etc to your hearts content.
5. To save, use alt-s (cmd-s on Mac ?)
6. Squeak will prompt you to overwrite doit.st. Alas I have not investigated how
to remove this prompt.

This file can now be opened with a conventional DOS editor like notepad and the
contents have the expected CRLF newlines.

Note. If you use the 'view as hex' menu option in the file viewer, you will only
see the 0d (CR). The CRLFFileStream strip the LF off when reading and inserts it
when writing the file. Smart stuff.


Cheers
Brent


-----------------------------------------------------------------
        Visit our Internet site at http://www.reuters.com

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.





More information about the Squeak-dev mailing list