<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://95.179.246.60/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Write_a_long_String_with_a_Stream</id>
	<title>Write a long String with a Stream - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://95.179.246.60/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Write_a_long_String_with_a_Stream"/>
	<link rel="alternate" type="text/html" href="http://95.179.246.60/mediawiki/index.php?title=Write_a_long_String_with_a_Stream&amp;action=history"/>
	<updated>2026-05-08T12:41:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>http://95.179.246.60/mediawiki/index.php?title=Write_a_long_String_with_a_Stream&amp;diff=91&amp;oldid=prev</id>
		<title>Nmingott: Created page with &quot;&#039;&#039;&#039;TODO&#039;&#039;&#039;. Redo the example without using structures the reader does not have.  &#039;&#039;&#039;Problem&#039;&#039;&#039;. You need to compose a long block of text, what you usually do in scripting languages is appending a String to another until you get what you need. You can do it also in Smalltalk but it is not recommended in books.  &#039;&#039;&#039;Solution&#039;&#039;&#039;. Adapted from &#039;&#039;&quot;Smalltalk by Example(1997)&quot;&#039;&#039;. You must guess approximately the size of the string you want to build, then open a write stream on i...&quot;</title>
		<link rel="alternate" type="text/html" href="http://95.179.246.60/mediawiki/index.php?title=Write_a_long_String_with_a_Stream&amp;diff=91&amp;oldid=prev"/>
		<updated>2025-05-04T20:23:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;TODO&amp;#039;&amp;#039;&amp;#039;. Redo the example without using structures the reader does not have.  &amp;#039;&amp;#039;&amp;#039;Problem&amp;#039;&amp;#039;&amp;#039;. You need to compose a long block of text, what you usually do in scripting languages is appending a String to another until you get what you need. You can do it also in Smalltalk but it is not recommended in books.  &amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;. Adapted from &amp;#039;&amp;#039;&amp;quot;Smalltalk by Example(1997)&amp;quot;&amp;#039;&amp;#039;. You must guess approximately the size of the string you want to build, then open a write stream on i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;TODO&amp;#039;&amp;#039;&amp;#039;. Redo the example without using structures the reader does not have.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problem&amp;#039;&amp;#039;&amp;#039;. You need to compose a long block of text, what you usually do in scripting languages is appending a String to another until you get what you need. You can do it also in Smalltalk but it is not recommended in books.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;. Adapted from &amp;#039;&amp;#039;&amp;quot;Smalltalk by Example(1997)&amp;quot;&amp;#039;&amp;#039;. You must guess approximately the size of the string you want to build, then open a write stream on it and add stuff. The better you guess the better the program will run, that is faster and without wasting memory. This code writes down a list of items as a CSV string that then you may write on disk.&lt;br /&gt;
 &amp;lt;code&amp;gt;st _ (String new: 10000) writeStream.&lt;br /&gt;
 st nextPutAll: (&amp;#039;name, code, weight \n&amp;#039; printf: #()).&lt;br /&gt;
 itemsList do: [ :item | &lt;br /&gt;
 	st nextPutAll: item name; nextPutAll: &amp;#039;, &amp;#039;.&lt;br /&gt;
 	st nextPutAll: item code; nextPutAll: &amp;#039;, &amp;#039;.&lt;br /&gt;
 	st nextPutAll: art weight asString; nextPut: Character newLineCharacter .&lt;br /&gt;
 	].&lt;br /&gt;
 outString _ st contents.&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nmingott</name></author>
	</entry>
</feed>