<div>This is in regards to using the display function and outputting to a text file. What I want to do is only write to this file when the user enters the function "hello". I notice a problem from my code below is that when I close the output port I am not able to write anything else to the file, but I believe closing the port is when the writing actually happens. </div>
<div> </div>
<div>(define o (open-output-file "helloworld.txt"))</div>
<div> </div>
<div>(define hello<br> (display "hello world" o) )</div>
<div> </div>
<div>(close-output-port o) </div>
<div> </div>
<div> </div>
<div>Why does "hello world" get written to helloworld.txt when I run this, even though it is within a function, and I never called that function in my interaction window?</div>
<div> </div>
<div>Any help would greatly be appreciated</div>
<div>Thanks</div>
<div>Jerron St. Armand</div>