thanks Ron, I hadn’t thought about class variables.  
<br/><br/>sincerely,
<br/><br/>Joe.
<br/><br/><div class='shrinkable-quote'><br/>&gt; On Jun 10, 2016, at 12:17 PM, Ron Teitelbaum [via Smalltalk] &lt;<a href="/user/SendEmail.jtp?type=node&node=4900705&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; wrote:
<br/>&gt; 
<br/>&gt; Hi Joe, 
<br/>&gt; 
<br/>&gt; I'm not sure in what context you mean. &nbsp;Why wouldn't you run this in the 
<br/>&gt; #initialize method? 
<br/>&gt; 
<br/>&gt; JoeAccountingParser class&gt;&gt;configure 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; InPath := '/Users/jja/Desktop/accountingfiles/'. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; OutPath := '/Users/jja/Desktop/accountingfiles processed/'. 
<br/>&gt; 
<br/>&gt; JoeAccountingParser &gt;&gt;initialize 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; self class configure. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; fileParser := FileParser new. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; fileParser inPath: self class InPath. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; fileParser outPath: self class OutPath. 
<br/>&gt; 
<br/>&gt; JoeAccountingParser class &gt;&gt; process: aFile 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; ^(self new) process: aFile; yourself. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;        
<br/>&gt; 
<br/>&gt; JoeAccountingParser process: aFile 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; fileParser readThis: aFile. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; fileParser process. 
<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; fileParser write. 
<br/>&gt; 
<br/>&gt; This is a bit refactored and it uses the configure method I recommend to you 
<br/>&gt; earlier. &nbsp;This configure method could be anything including a method to read 
<br/>&gt; an external file for details. 
<br/>&gt; 
<br/>&gt; Solutions like a factory method pattern come to mind if you don't want to 
<br/>&gt; use #initialize. 
<br/>&gt; 
<br/>&gt; JoeAccountingParser class &gt;&gt; process: aFile from: inPath to: outPath 
<br/>&gt; 
<br/>&gt; There is also Behavior #startUp and #shutDown on the class side. 
<br/>&gt; 
<br/>&gt; See Smalltalk #addToStartUpList: #addToShutDownList: 
<br/>&gt; 
<br/>&gt; These fire when an image is started or shutdown. &nbsp; 
<br/>&gt; 
<br/>&gt; I think a bit more explanation of what problem you are having is needed. 
<br/>&gt; 
<br/>&gt; All the best, 
<br/>&gt; 
<br/>&gt; Ron Teitelbaum 
<br/>&gt; 
<br/>&gt; 
<br/>&gt; 
<br/>&gt; &gt; From: Joseph Alotta 
<br/>&gt; &gt; Sent: Friday, June 10, 2016 12:23 PM 
<br/>&gt; &gt; 
<br/>&gt; &gt; Greetings, 
<br/>&gt; &gt; 
<br/>&gt; &gt; My object needs to have some variables set before it can run the 
<br/>&gt; initialize
<br/>&gt; 
<br/>&gt; &gt; method and also it needs to have run an exit method. 
<br/>&gt; &gt; 
<br/>&gt; &gt; f := FileParser new. 
<br/>&gt; &gt; f inPath: '/Users/jja/Desktop/accountingfiles/'. 
<br/>&gt; &gt; f readThis: 'rei mastercard.csv'. 
<br/>&gt; &gt; f process 
<br/>&gt; &gt; f outPath: '/Users/jja/Desktop/accountingfiles processed/'. 
<br/>&gt; &gt; f write. 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; Is there a better way to do this? 
<br/>&gt; &gt; 
<br/>&gt; &gt; Sincerely, 
<br/>&gt; &gt; 
<br/>&gt; &gt; Joe. 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; _______________________________________________ 
<br/>&gt; &gt; Beginners mailing list 
<br/>&gt; &gt; [hidden email] 
<br/>&gt; &gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br/>&gt; 
<br/>&gt; _______________________________________________ 
<br/>&gt; Beginners mailing list 
<br/>&gt; [hidden email] 
<br/>&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br/>&gt; 
<br/>&gt; 
<br/>&gt; If you reply to this email, your message will be added to the discussion below:
<br/>&gt; <a href="http://forum.world.st/set-variables-before-initialize-and-write-out-files-before-exit-tp4900437p4900450.html" target="_top" rel="nofollow" link="external">http://forum.world.st/set-variables-before-initialize-and-write-out-files-before-exit-tp4900437p4900450.html</a><br/>&gt; To start a new topic under Squeak - Beginners, email <a href="/user/SendEmail.jtp?type=node&node=4900705&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a> 
<br/>&gt; To unsubscribe from Squeak - Beginners, click here.
<br/>&gt; NAML
</div><br/>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://forum.world.st/set-variables-before-initialize-and-write-out-files-before-exit-tp4900437p4900705.html">Re: set variables before initialize and write out files        before exit</a><br/>
Sent from the <a href="http://forum.world.st/Squeak-Beginners-f107673.html">Squeak - Beginners mailing list archive</a> at Nabble.com.<br/>