<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p><br>
</p>
The only screenshot I saw was the black queen at the end. I don't know if it is a "feature" of the digest, or a "feature" of the Outlook version they let us use at Georgia College, but I seldom get screen shots.<br>
Thanks for the "text" explanation<br>
<br>
I played around with what you sent me: changing the "When the World starts" to "While the World runs" then dragging "world.my first method" into each of "begin", "During" and "end"<br>
The null pointer error only occurs in the "end" and only after the "Play" window is closed, or "stop" is clicked on that window which also closes it.<br>
I tried dragging a non-world object primitive action into "end" ("ground.say"goodbye") and did not get the null pointer exception. (didn't see the message either, but that makes sense that I wouldn't)<br>
<br>
I created a new method (ground.test) and dragged it into "end" and got the null-pointer exception only after I closed the "play" window.<br>
<br>
Don;<br>
>> <span>Disabling the ability to change the ?when the world starts?</span><br>
Very bad idea.  It would break existing code including 7 years of my student's efforts, and at least 3 chapters (6, 8, 10) of the book I and the rest of those who are teaching CSCI-1000 here at Georgia College are using plus the corresponding CIS-110 class
 I'm teaching at Georgia Military College. Frankly I've never ran into this situation before because hooking something to the end condition of "while the world is running" is not something we thought made sense to do.<br>
<br>
Since the error only occurs when the "play" window is closed. I Think (not actually looking at the "play" window close handler) that it could be captured there with an exception handler that would catch the null handle exception and kill it before it got high
 enough to be visible.<br>
<br>
Or you could take a suggestion from "Are Your Lights On?: How to determine what the problem really is" (a really good book. I highly recommend) and warn everyone to not to mess with the end statement when changing from "When the world starts" to "While the
 world is running"<br>
<br>
Best<br>
Bob Durtschi<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div class="PlainText">-------------------------------<br>
<br>
Sorry, I guess you couldn?t see my screenshot. Below is my code that demonstrates the problem. It seems like the world itself is already gone when the End code is executed. You don?t even need any code in the method that is called.<br>
Events<br>
While the world is running<br>
Begin:  <None><br>
<br>
During: <None><br>
<br>
End:<br>
world.my first method<br>
<br>
<br>
<br>
Methods<br>
  world.my first method ( )<br>
    No variables<br>
        Do Nothing<br>
<br>
?<br>
James Vanderhyde<br>
Assistant Professor, Computer Science<br>
Program Director, Master of Applied Computer Science<br>
Saint Xavier University<br>
3700 W. 103rd St.<br>
Chicago, IL 60655<br>
773-298-3454<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 28 Feb 2017 14:33:16 -0500<br>
From: Donald Slater <djslater107@mac.com><br>
To: Alice Teachers <alice-teachers@lists.andrew.cmu.edu><br>
Subject: Re: alice-teacher s Digest, Vol 77, Issue 20<br>
Message-ID: <41F449AC-66CE-4C3A-A1F4-DDCBFC4F1BC3@mac.com><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
If I have been following this thread correctly...<br>
<br>
Definitely a problem. Trying to execute something when Alice has quit running the program does not, make sense, on the face of it. Possible options:<br>
<br>
        1) Disabling the ability to change the ?when the world starts? event to ?while the world is running?. The Begin: and During: options have utility while the world is running. But this could be handled (clumsily, perhaps) by creating a method with the
 "while something is true?? event inside of it. <br>
<br>
        2) Removing the End: option, so that you can execute something when the world Begins: or During: program execution.<br>
<br>
        3) Alice could check to see if there is something called in the End: option before completely terminating the thread. I think that this would provide the behavior that Jim was looking for.<br>
<br>
Other thoughts / suggestions?<br>
<br>
Don Slater<br>
<br>
Alice Project<br>
Carnegie Mellon University<br>
Entertainment Technology Center<br>
700 Technology Drive<br>
Pittsburgh, PA 15219<br>
<br>
Email: dslater@cmu.edu</div>
</div>
<font size="2"><span style="font-size:10pt;"></span></font></div>
</div>
</body>
</html>