[newbie] Reading files, printing

Bob Arning arning at charm.net
Sat Sep 25 18:33:49 UTC 1999


On Sat, 25 Sep 1999 10:53:34 -0400 Aron Brener <brener at home.com> wrote:
>I'm having trouble figuring out 2 things this time. One is how to 
>read an ascii file, line by line, so I can parse each line.  I also 
>need a way for the user to select the file he needs.

This should do what you need:

f _ StandardFileMenu oldFileStream.
f ifNotNil: [
	[f atEnd] whileFalse: [
		line _ f nextLine.
		"do your thing here like: "
		Transcript show: line; cr.
	].
	f close
].

>The other thing, is once I have a Morph, is there a way to send it to 
>the printer?

Check out the newly released Postscript stuff.

Cheers,
Bob





More information about the Squeak-dev mailing list