<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Don&#39;t rewrite your old code</title>
		<link>http://www.allegro.cc/forums/view/590597</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 02 Apr 2007 19:25:42 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>nice little article <a href="http://www.joelonsoftware.com/articles/fog0000000069.html">here</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Sun, 18 Mar 2007 01:21:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hah. In some cases you <u>have</u> to rewrite. Ironically, like the Netscape 4. From what I gather it was SO horrible, that they <u>couldn&#39;t</u> continue with it. I know for a fact that the later 4.x versions were horribly buggy, and lacking in features.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 18 Mar 2007 01:23:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t agree with his blanket statement. (Yes, I read the article.) I&#39;m sure it&#39;s true under some circumstances, but in my experience if you come across code written by incompetent fools, you are better off burning it and starting over.</p><p>For instance, at a previous job in a previous life, a co-worker had been working on a web project for three months. The project manager came to me and asked me to &quot;take over&quot; since the deadline was rapidly approaching. After taking one look at the code, my eyes started to bleed. That weekend, I re-wrote the entire thing from scratch. Came in on that Monday, and handed it him. I couldn&#39;t care less that it meant they just wasted three months of salary on her. </p><p>Now I know that Joel is talking about re-writing code that already &quot;works,&quot; so my example may not be at all what he is talking about. But he considered Netscape 4 as something that &quot;worked,&quot; which is a very bad example. Netscape 4 was very screwed up; IE 4 was blowing it away. He obviously never had to look at it from a developer&#39;s perspective.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 18 Mar 2007 01:29:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Matthew said:</div><div class="quote"><p>
He obviously never had to look at it from a developer&#39;s perspective.
</p></div></div><p>
I don&#39;t think he looked at it from a USER&#39;s perspective.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 18 Mar 2007 01:32:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I don&#39;t think he looked at it from a USER&#39;s perspective.
</p></div></div><p>
To be clear, I mean a 3rd party web-developer as opposed to a Netscape developer.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 18 Mar 2007 01:46:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Old.</p><p>[EDIT]<br />Although I agree with the article.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michael Faerber)</author>
		<pubDate>Sun, 18 Mar 2007 02:14:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It&#39;s important to remember that when you start from scratch there is absolutely no reason to believe that you are going to do a better job than you did the first time.
</p></div></div><p>

My personal experience:<br />One thing to avoid the &quot;start from scratch all over again&quot; is to re-write and re-design your project from time to time, to make it more readable.<br />In my current project I re-designed a few classes that already worked perfect! but I was not happy with them, because they looked a bit messy, I spent time in the re-design, and I am sure that players will never notice the difference, but as a developer I feel better, because now I have a more legible code.<br />I allways try to achieve readability because, as the articles said:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It&#39;s harder to read code than to write it
</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Paul whoknows)</author>
		<pubDate>Sun, 18 Mar 2007 05:28:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ya I&#39;m not sure about that point.  I doubt source code from Netscape 4.0 would stand a chance against all the new standards for CSS and javascript.  Maybe some code could be preserved, but the majority could not.</p><p>In the feedback link they talk about redoing the FTP code.  Heh, now <b>that</b> makes no sense at all.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Sun, 18 Mar 2007 05:46:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That Joel guy would not get a job at the company I work for. <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" />
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
There&#39;s a subtle reason that programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: <i>they are probably wrong.</i> The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming:<br /><b>It&#39;s harder to read code than to write it.</b>
</p></div></div><p>
Let me reword that.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
There&#39;s a subtle reason that programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: <i>they are probably right.</i> The reason that the old code is a mess is because they don&#39;t know a cardinal, fundamental law of programming:<br /><b>If you code like a muppet, neither you nor anyone else will even bother trying to read your code.</b> (It might help to get a clue before rewriting it.)
</p></div></div><p>
We have some golden library design rules at work. They work amazingly well. We can understand our code six months later (shock!), and we can all modify each other&#39;s code with confidence and success. It&#39;s great! <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /></p><p>[EDIT]<br />Actually, he changes his mind halfway through. He starts off by saying that old code isn&#39;t messy, but then he changes his mind and concedes that actually it is messy and does need careful refactoring (which is often true). He might get a job then. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Sun, 18 Mar 2007 08:04:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
To be clear, I mean a 3rd party web-developer as opposed to a Netscape developer.
</p></div></div><p>Ah, ok. But to be clear, I mean from a plain old user&#39;s perspective.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 18 Mar 2007 11:55:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Slightly off-topic: Among artists it is common practice to redo some of their old works to learn and to see how they have improved over time. Maybe that&#39;s the same reason to rewrite old code, aside from the functional reason of course (code that doesn&#39;t work just needs to be fixed/rewritten, whereas a crappy piece of art can still stay as it is, as it doesn&#39;t have a well defined function like code has).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Sun, 18 Mar 2007 15:55:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That is called extreme programming: you program thinking in today and dismissing tomorrow. So, instead of thinking &quot;I may need a new argument for this function&quot; you say &quot;I only need these arguments for this function&quot;. It is good for evolutionary design, the one where you need to create a prototype, show it to clients, get suggestions, and then update the prototype with the suggestions. We used it at work, but found it to be costly (especially when you have a limited number of programmers).</p><p>The truth is, when you are dealing with a 9 year old product (like the one I work with), you usually find several old paradigms that are outdated, and need to write a lot of code again. Personally, in four years I threw many components away, trimmed others, and fully recreated the contraindication module, the drug database, the graphical interface, allergies and, after three weeks, the settings (so that you can query for settings or show the graphical interface to change settings anywhere in the program, for maximum customization). None of these changes would have been possible with the old code (to give some examples, in Visual Basic nobody used implementations until three years ago, there were copies of the same function everywhere, and there were even <i>rem</i> comments... and in the C++ part, a component had created the full COM interface manually, hardcoding the GUIDs, another had an abusive hierarchy of 15 levels, none of which has siblings--think in a hierarchy that looks like a vertical line without branches--, and another was a horizontal one, where leaves did not inherit from each other but instead always repeated code from other classes).</p><p>Gamasutra has a feature about it, <a href="http://www.gamasutra.com/features/20070301/schofield_01.shtml">Embracing Fun: Why Extreme Programming is Great for Game Development</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Sun, 18 Mar 2007 21:46:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&quot;Don&#39;t rewrite your old code&quot; is a great title, actually. It doesn&#39;t say &quot;Don&#39;t rewrite somebody else&#39;s old code&quot;.</p><p>Sometimes the title is ten times better than the article itself <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Simon Parzer)</author>
		<pubDate>Sun, 18 Mar 2007 23:43:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Joel makes a good point, <i>from a business perspective</i>. If you&#39;ve got a product that &quot;works&quot;, reverting back to something that doesn&#39;t makes no sense at all.</p><p>That doesn&#39;t mean that a certain subset of the code can&#39;t be rewritten. In fact, it&#39;s probably a good idea to pull out a chunk of code, do some spring cleaning (and by which, I mean rewrite it), and refit it back into the codebase. </p><p>When you&#39;re dealing with 0.25+ MLOC codebases, rewriting and redebugging them in their entirety is often not a viable option.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
We have some golden library design rules at work. They work amazingly well.
</p></div></div><p>
How well do they work on a long-term basis? Over a 3-5 year basis, yes it&#39;s possible to come up with rules and techniques to keep things manageable. When you have a 8+ year old codebase, a lot of things tend to change over time to make the existing code inadequate.</p><p>The metric I use is a shelf life of good quality code is 5 years. Call it Bob&#39;s Law if you will <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> Basically, you will need to rewrite your code every 5 years. Plan for it.</p><p>Code does rot. Not because the code itself functions less over time, or because defects magically insert themselves. It&#39;s simply because the requirements change, and keep changing even after the product has shipped. These requirements may not even be under your control, or the control of your company. For example, the OS changes, CPUs get faster, you now need a port to some other platform, etc. The existing code, being static by definition, does not keep up with these changes.</p><p>When you do need to make changes to the codebase, you also need to look at things from a business perspective. What&#39;s the !/$ of the change? Do the small incremental changes you need to make warrant a complete rewrite to make them a better fit for the architecture?</p><p>Of course, you also need to weigh in some metric based on the &quot;mass&quot; of the code. Is the code in such as shape that it will collapse onto itself and turn into a blackhole, sucking all development time into nothingness?</p><p>I don&#39;t know what the state of Netscape 4 was at the time. In retrospect, it was definitely a bad idea to rewrite it from scratch. But the neat thing about hindsight is that it&#39;s always 20/20. It cost Netscape 2 years of time where they had no new product on the market. No new product == no income. Loss of market share and mindshare. That&#39;s a really bad position to be in, business wise.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob)</author>
		<pubDate>Mon, 19 Mar 2007 02:45:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am shared.</p><p>Don&#39;t we always say that reinventing the wheel is bad ?</p><p>Of course, if the code is a total mess, then rewrite ! But if it is good code, nicely organized and structured, where is the need huh ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Mon, 19 Mar 2007 03:00:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I don&#39;t know what the state of Netscape 4 was at the time. In retrospect, it was definitely a bad idea to rewrite it from scratch. But the neat thing about hindsight is that it&#39;s always 20/20. It cost Netscape 2 years of time where they had no new product on the market. No new product == no income. Loss of market share and mindshare. That&#39;s a really bad position to be in, business wise.
</p></div></div><p>
Netscape didn&#39;t make any proffit from The browser at that point anyway, Microsoft forced them to give it away. All it cost was the manpower to write it. And they did get <u>some</u> help from the community (albeit not that much).</p><p>Netscape made a majority of their income from their server business even when they were selling the browser. And it shows in how they let the browser rot.</p><p>That said, excellent view Bob. I&#39;m adding this to my threadbook.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 19 Mar 2007 03:02:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
How well do they work on a long-term basis?
</p></div></div><p>
For the point I was making, they should work for ever. All our golden rules are ultimately designed to keep the code clear and easy to work with. Of course we have to rewrite or adjust code if requirements change (or if Sun break Java) - but we never have to rewrite code just because we can&#39;t understand it. Joel&#39;s point was that people have trouble reading other people&#39;s code or their own old code, and that just isn&#39;t true for us. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Now, Sun&#39;s standard library code, on the other hand ... <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /> Jesus Christ. No wonder they break Java so often.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Mon, 19 Mar 2007 04:28:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Something I have learned in five years as professional programmer: you never rewrite code to fix bugs, you rewrite it to add new features.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Mon, 19 Mar 2007 09:08:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Something I have learned in five years as professional programmer: you never rewrite code to fix bugs, you rewrite it to add new features.
</p></div></div><p>

I do exactly the opposite! But then again, the code I work with has a low average quality.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob)</author>
		<pubDate>Mon, 19 Mar 2007 10:38:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If the wheel doesn&#39;t fit the cart, you need a new wheel.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Mon, 19 Mar 2007 11:22:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Trezker said:</div><div class="quote"><p>
If the wheel doesn&#39;t fit the cart, you need a new wheel.
</p></div></div><p>
<a href="http://www.allegro.cc/forums/thread/519180/520290#target">Then invent it!</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Mon, 19 Mar 2007 17:19:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If the wheel doesn&#39;t fit the cart, you need a new wheel.
</p></div></div><p>

Or a new cart. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Indeterminatus)</author>
		<pubDate>Mon, 19 Mar 2007 18:18:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Or a new axel to piece together the two incompatible things <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HoHo)</author>
		<pubDate>Mon, 19 Mar 2007 18:20:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>..or an elephant to drag the cart along without its wheels.  ..or an assassin to wipe out the client waiting for the cart.  I&#39;m sure these can be massaged into metaphors for certain industry practices <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matt Smith)</author>
		<pubDate>Mon, 19 Mar 2007 23:36:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>When the cost of modifying the cart to fit the wheel is greater than the cost of getting a new wheel, you should get a new wheel.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Tue, 20 Mar 2007 02:26:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Why use that old cart? When you can get... the Ultra-Cart 5000! Its fast, its sleek, its wheels are always compatible with the cart and the axle*. And what&#39;s more, it requires no elephant** and is assassin resistant***. Only two hundred seventy-six EASY payments of $99.99****! Supplies are limited, buy now.</p><p>-----------------------------------------------------------------------------------</p><p>*Wheel-axle-cart compatability not guaranteed.<br />**Elephant may be required in polar regions.<br />***Assassin defenses are limited to the delux edition.<br />****Must be paid in cash and all the payments are required within two days of purchase.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Wed, 21 Mar 2007 17:52:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have a double moral.</p><p>I like to rewrite from scratch my own code, because I do it as a hobby, and is fun, and educational, and I usually get better results.</p><p>I don&#39;t like, and I don&#39;t think that is good (usually, there are cases were is good) to rewrite business code from working systems that are used to generate revenue. In those systems, I think that the KISS approach, and the &quot;don&#39;t fix it until it is broken&quot; really apply.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kronoman)</author>
		<pubDate>Thu, 22 Mar 2007 06:58:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s what branching is for.<br />When something isn&#39;t broken but you would gain a lot by impoving it, you create a branch so you can work on it until it works without messing up the trunk.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Thu, 22 Mar 2007 12:17:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>my old code needs rewriting. And this is only a few weeks old <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>it works, though.</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="p">#include &lt;fstream&gt;</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td>&#160;</td></tr><tr><td class="number">4</td><td><span class="k1">int</span> Dialouge<span class="k2">(</span><span class="k1">int</span> TextC <span class="k3">=</span> <span class="n">255</span>, <span class="k1">int</span> TextX <span class="k3">=</span> <span class="n">420</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">5</td><td>     <a href="http://www.allegro.cc/manual/clear_keybuf" target="_blank"><span class="a">clear_keybuf</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">6</td><td>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">0</span>, <span class="n">410</span>, <span class="n">640</span>, <span class="n">480</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">7</td><td>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">1</span>, <span class="n">411</span>, <span class="n">639</span>, <span class="n">479</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">192</span>, <span class="n">192</span>, <span class="n">192</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">2</span>, <span class="n">412</span>, <span class="n">638</span>, <span class="n">478</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">128</span>, <span class="n">128</span>, <span class="n">128</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">3</span>, <span class="n">413</span>, <span class="n">637</span>, <span class="n">477</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">96</span>, <span class="n">96</span>, <span class="n">96</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">4</span>, <span class="n">414</span>, <span class="n">636</span>, <span class="n">476</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">64</span>, <span class="n">64</span>, <span class="n">64</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">11</td><td>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">5</span>, <span class="n">415</span>, <span class="n">635</span>, <span class="n">475</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">32</span>, <span class="n">32</span>, <span class="n">32</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>     <a href="http://www.allegro.cc/manual/rectfill" target="_blank"><span class="a">rectfill</span></a><span class="k2">(</span>buffer, <span class="n">6</span>, <span class="n">416</span>, <span class="n">634</span>, <span class="n">474</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>     <span class="k1">int</span> x <span class="k3">=</span> <span class="n">20</span>, y <span class="k3">=</span> <span class="n">420</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>     <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> message.size<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">15</td><td>         <a href="http://www.allegro.cc/manual/textprintf_ex" target="_blank"><span class="a">textprintf_ex</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, x, y,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">255</span>,<span class="n">255</span><span class="k2">)</span>,<span class="k3">-</span><span class="n">1</span>,<span class="s">"%c"</span>,message<span class="k3">&lt;</span>i&gt;<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td>         x <span class="k3">+</span><span class="k3">=</span> <span class="n">8</span><span class="k2">;</span> <span class="c">// whatever your font may be</span></td></tr><tr><td class="number">17</td><td>         <span class="k1">if</span><span class="k2">(</span>x <span class="k3">&gt;</span><span class="k3">=</span> <span class="n">612</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">18</td><td>              x <span class="k3">=</span> <span class="n">20</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>              y <span class="k3">+</span><span class="k3">=</span> <span class="n">10</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td>         <span class="k2">}</span></td></tr><tr><td class="number">21</td><td>         </td></tr><tr><td class="number">22</td><td>         <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, buffer, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">23</td><td>         </td></tr><tr><td class="number">24</td><td>         <a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span><span class="n">25</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td>     <span class="k2">}</span></td></tr><tr><td class="number">26</td><td><span class="k2">}</span></td></tr><tr><td class="number">27</td><td>&#160;</td></tr><tr><td class="number">28</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">29</td><td>    <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">30</td><td>    <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">31</td><td>    <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><span class="n">16</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">32</td><td>    <a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span> GFX_AUTODETECT_FULLSCREEN, <span class="n">640</span>, <span class="n">480</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">33</td><td>    </td></tr><tr><td class="number">34</td><td>    buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">35</td><td>    Col_Map <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">36</td><td>    Col_Block <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><span class="n">32</span>, <span class="n">32</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">37</td><td>    <a href="http://www.allegro.cc/manual/clear_to_color" target="_blank"><span class="a">clear_to_color</span></a><span class="k2">(</span>Col_Block, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">38</td><td>    Col_Empty <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><span class="n">32</span>, <span class="n">32</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">39</td><td>    <a href="http://www.allegro.cc/manual/clear_to_color" target="_blank"><span class="a">clear_to_color</span></a><span class="k2">(</span>Col_Empty, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">40</td><td>    </td></tr><tr><td class="number">41</td><td>    Warrior <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Characters/Warrior.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">42</td><td>    Grass <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Grass.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">43</td><td>    Floor <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Floor.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">44</td><td>    Water <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Water.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">45</td><td>    Rock <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Rock.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">46</td><td>    Tree <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Tree.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">47</td><td>    Door <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Door.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">48</td><td>    Stone_Wall <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Stone Wall.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">49</td><td>    Stone_Wall_Top <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Stone Wall Top.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">50</td><td>    Stone_Wall_Turret <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Stone Wall Turret.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">51</td><td>    Rock_Wall <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Rock Wall.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">52</td><td>    Wood_Wall <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Wood Wall.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">53</td><td>    Wood_Roof <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Wood Roof.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">54</td><td>    Cabinet <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/Cabinet.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">55</td><td>    Bed_Top <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/BedTop.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">56</td><td>    Bed_Bottom <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> <span class="s">"Tiles/BedBottom.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">57</td><td>    </td></tr><tr><td class="number">58</td><td>    Game_Speed <span class="k3">=</span> <span class="n">50</span><span class="k2">;</span></td></tr><tr><td class="number">59</td><td>    </td></tr><tr><td class="number">60</td><td>    Load_Maps<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">61</td><td>    </td></tr><tr><td class="number">62</td><td>    Plr.X <span class="k3">=</span> <span class="n">256</span><span class="k2">;</span></td></tr><tr><td class="number">63</td><td>    Plr.Y <span class="k3">=</span> <span class="n">32</span><span class="k2">;</span></td></tr><tr><td class="number">64</td><td>    Plr.Cell <span class="k3">=</span> <span class="n">11</span><span class="k2">;</span></td></tr><tr><td class="number">65</td><td>    Plr.Spd <span class="k3">=</span> <span class="n">8</span><span class="k2">;</span></td></tr><tr><td class="number">66</td><td>    Plr.Facing <span class="k3">=</span> <span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">67</td><td>    Plr.Anim_Frame <span class="k3">=</span> <span class="n">2</span><span class="k2">;</span></td></tr><tr><td class="number">68</td><td>    </td></tr><tr><td class="number">69</td><td>    <span class="k1">while</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">70</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_DOWN<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">71</td><td>                                           <span class="k1">if</span><span class="k2">(</span>Check_Collision<span class="k2">(</span><span class="n">1</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">1</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">72</td><td>                                                              Plr.Anim_Frame<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">73</td><td>                                                              <span class="k1">if</span><span class="k2">(</span>Plr.Anim_Frame <span class="k3">&gt;</span> <span class="n">3</span><span class="k2">)</span> Plr.Anim_Frame <span class="k3">=</span> <span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">74</td><td>                                                              Plr.Facing <span class="k3">=</span> <span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">75</td><td>                                                              Plr.Y <span class="k3">+</span><span class="k3">=</span> Plr.Spd<span class="k2">;</span></td></tr><tr><td class="number">76</td><td>                                           <span class="k2">}</span></td></tr><tr><td class="number">77</td><td>                         <span class="k2">}</span><span class="k1">else</span></td></tr><tr><td class="number">78</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_UP<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">79</td><td>                                           <span class="k1">if</span><span class="k2">(</span>Check_Collision<span class="k2">(</span><span class="n">2</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">1</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">80</td><td>                                                              Plr.Anim_Frame<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">81</td><td>                                                              <span class="k1">if</span><span class="k2">(</span>Plr.Anim_Frame <span class="k3">&gt;</span> <span class="n">6</span> <span class="k3">|</span><span class="k3">|</span> Plr.Anim_Frame <span class="k3">&lt;</span> <span class="n">4</span><span class="k2">)</span> Plr.Anim_Frame <span class="k3">=</span> <span class="n">4</span><span class="k2">;</span></td></tr><tr><td class="number">82</td><td>                                                              Plr.Facing <span class="k3">=</span> <span class="n">2</span><span class="k2">;</span></td></tr><tr><td class="number">83</td><td>                                                              Plr.Y <span class="k3">-</span><span class="k3">=</span> Plr.Spd<span class="k2">;</span></td></tr><tr><td class="number">84</td><td>                                           <span class="k2">}</span></td></tr><tr><td class="number">85</td><td>                         <span class="k2">}</span><span class="k1">else</span></td></tr><tr><td class="number">86</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_RIGHT<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">87</td><td>                                           <span class="k1">if</span><span class="k2">(</span>Check_Collision<span class="k2">(</span><span class="n">3</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">1</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">88</td><td>                                                              Plr.Anim_Frame<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">89</td><td>                                                              <span class="k1">if</span><span class="k2">(</span>Plr.Anim_Frame <span class="k3">&gt;</span> <span class="n">9</span> <span class="k3">|</span><span class="k3">|</span> Plr.Anim_Frame <span class="k3">&lt;</span> <span class="n">7</span><span class="k2">)</span> Plr.Anim_Frame <span class="k3">=</span> <span class="n">7</span><span class="k2">;</span></td></tr><tr><td class="number">90</td><td>                                                              Plr.Facing <span class="k3">=</span> <span class="n">3</span><span class="k2">;</span></td></tr><tr><td class="number">91</td><td>                                                              Plr.X <span class="k3">+</span><span class="k3">=</span> Plr.Spd<span class="k2">;</span></td></tr><tr><td class="number">92</td><td>                                           <span class="k2">}</span></td></tr><tr><td class="number">93</td><td>                         <span class="k2">}</span><span class="k1">else</span></td></tr><tr><td class="number">94</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_LEFT<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">95</td><td>                                           <span class="k1">if</span><span class="k2">(</span>Check_Collision<span class="k2">(</span><span class="n">4</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">1</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">96</td><td>                                                              Plr.Anim_Frame<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span></td></tr><tr><td class="number">97</td><td>                                                              <span class="k1">if</span><span class="k2">(</span>Plr.Anim_Frame <span class="k3">&gt;</span> <span class="n">12</span> <span class="k3">|</span><span class="k3">|</span> Plr.Anim_Frame <span class="k3">&lt;</span> <span class="n">10</span><span class="k2">)</span> Plr.Anim_Frame <span class="k3">=</span> <span class="n">10</span><span class="k2">;</span></td></tr><tr><td class="number">98</td><td>                                                              Plr.Facing <span class="k3">=</span> <span class="n">4</span><span class="k2">;</span></td></tr><tr><td class="number">99</td><td>                                                              Plr.X <span class="k3">-</span><span class="k3">=</span> Plr.Spd<span class="k2">;</span></td></tr><tr><td class="number">100</td><td>                                           <span class="k2">}</span></td></tr><tr><td class="number">101</td><td>                         <span class="k2">}</span></td></tr><tr><td class="number">102</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_PLUS_PAD<span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> Game_Speed <span class="k3">&gt;</span> <span class="n">5</span><span class="k2">)</span> Game_Speed <span class="k3">-</span><span class="k3">=</span> <span class="n">5</span><span class="k2">;</span></td></tr><tr><td class="number">103</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_MINUS_PAD<span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> Game_Speed <span class="k3">&lt;</span> <span class="n">295</span><span class="k2">)</span> Game_Speed <span class="k3">+</span><span class="k3">=</span> <span class="n">5</span><span class="k2">;</span></td></tr><tr><td class="number">104</td><td>                         </td></tr><tr><td class="number">105</td><td>                         <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_SPACE<span class="k2">]</span><span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">106</td><td>                                            <span class="c">//Text1 = "Okay, so the dialouge works.";</span></td></tr><tr><td class="number">107</td><td>                                            <span class="c">//Text2 = "I hope...";</span></td></tr><tr><td class="number">108</td><td>                                            <span class="c">//Text3 = "Maybe this will confirm that hope,";</span></td></tr><tr><td class="number">109</td><td>                                            <span class="c">//Text4 = "but if it doesn't then I'll just have to keep working.";</span></td></tr><tr><td class="number">110</td><td>                                            <span class="c">//Text5 = "Wow, The formatting on this looks like crap.";</span></td></tr><tr><td class="number">111</td><td>                                            message <span class="k3">=</span> <span class="s">"Possumdude0: Okay, so this should display properly on screen, although    there is no word-wrap, so I'll have to do it manually"</span><span class="k2">;</span></td></tr><tr><td class="number">112</td><td>                                            Dialouge<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>                                           </td></tr><tr><td class="number">113</td><td>                         <span class="k2">}</span></td></tr><tr><td class="number">114</td><td>                         </td></tr><tr><td class="number">115</td><td>                         Cell_Events<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">116</td><td>                         Events<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">117</td><td>                         </td></tr><tr><td class="number">118</td><td>                         Draw_Screen<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">119</td><td>                         </td></tr><tr><td class="number">120</td><td>                         <a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span>Game_Speed<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">121</td><td>                                           </td></tr><tr><td class="number">122</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">123</td><td><span class="k2">}</span></td></tr><tr><td class="number">124</td><td><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Thu, 22 Mar 2007 18:06:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
</p><div class="source-code snippet"><div class="inner"><pre>     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">0</span>, <span class="n">410</span>, <span class="n">640</span>, <span class="n">480</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">1</span>, <span class="n">411</span>, <span class="n">639</span>, <span class="n">479</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">192</span>, <span class="n">192</span>, <span class="n">192</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">2</span>, <span class="n">412</span>, <span class="n">638</span>, <span class="n">478</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">128</span>, <span class="n">128</span>, <span class="n">128</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">3</span>, <span class="n">413</span>, <span class="n">637</span>, <span class="n">477</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">96</span>, <span class="n">96</span>, <span class="n">96</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">4</span>, <span class="n">414</span>, <span class="n">636</span>, <span class="n">476</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">64</span>, <span class="n">64</span>, <span class="n">64</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
     <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span>buffer, <span class="n">5</span>, <span class="n">415</span>, <span class="n">635</span>, <span class="n">475</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">32</span>, <span class="n">32</span>, <span class="n">32</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
     <a href="http://www.allegro.cc/manual/rectfill" target="_blank"><span class="a">rectfill</span></a><span class="k2">(</span>buffer, <span class="n">6</span>, <span class="n">416</span>, <span class="n">634</span>, <span class="n">474</span>, <a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div></div><p>
Ever heard of for loops? <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /><br />Then there&#39;s the clear_keybuf() (In a drawing function. When you&#39;re not even using readkey().), the non-returning main, the complete lack of return value checking... Gah!</p><p>And for the love of the Antichrist, stop using rest() timing...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Thu, 22 Mar 2007 18:10:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would look into using a DATAFILE to store your images. it would make it easier to keep track of later.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Taiko Keiji)</author>
		<pubDate>Thu, 22 Mar 2007 23:14:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I told you it needs re-writing.;D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Fri, 23 Mar 2007 17:39:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>At the present I&#39;m very attempted to rewrite one application. It has a rather large allegro dialog struct and the indices are somehow wrong. Months ago I added something to the dialog and never got it ready. Now I need to make it ready and I have a hard time debugging it. It compiles and runs, but doesn&#39;t do the thing it should. And it is because indices are wrong. It&#39;s all about image manipulation and I have these radio buttons for whether creating a new file or overwriting the old. And some buttons for jpg quality. So when I wan&#39;t to make resized copies of all images in a folder, it overwrites all images with b/w, unresized, really screwed up versions of the images.</p><p>The main problem is only in my coding style. I haven&#39;t figured out how to write maintainable code what comes to allegro dialogs. It would be nice to have a way of using macros or something for the indices, so if you add one item in the middle of the dialog struct, you wouldn&#39;t have to change the indices all over the code. I bet masking or any other gui lib handles this better.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Sat, 24 Mar 2007 12:26:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That code does not need rewriting!! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /></p><p>I read it quickly and understood it pretty easily. I don&#39;t know what all the functions you haven&#39;t included do, but there&#39;s nothing in there that looks particularly bad. Fixing the location of the clear_keybuf call is a question of moving the line from one place to another. The &#39;rest&#39; timing thing is a bit harder to fix, but only because Allegro has such a horrible timing API (it doesn&#39;t even have a &#39;get current time&#39; function) - and it&#39;s still only a question of writing more code, not throwing the old code away. (The problem is that the code running in between calls to &#39;rest&#39; also takes time, thereby slowing the game down on slower computers, since gnolam didn&#39;t have the manners to tell you.) You could change it to use datafiles, but you don&#39;t have to; I don&#39;t see how it makes it easier, it just keeps everything nicely in one file and allows you to compress it. And there is no need to write that series of rects as a loop; the existing code is short and it&#39;s clear, and if you use a loop, you&#39;ll have to generate the series of colour values somehow - perhaps using an array. It&#39;ll also be slower. There&#39;s just no point.</p><p>Seriously, don&#39;t rewrite that code. There&#39;s nothing fundamentally wrong with it. There may be tweaks you can make, or you may have to rethink parts of it as you add to the project (but only if they don&#39;t work or start getting messy), but that&#39;s it.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I haven&#39;t figured out how to write maintainable code what comes to allegro dialogs.
</p></div></div><p>
Sounds to me as if that&#39;s your only reason not to like the project. I also remember having a bit of trouble with that myself. I think I built the array up at run time, using a macro that fills all the fields in and then increments a counter - and then, when I needed to know an index, I just added a line that copied the value of the counter variable. That would be a bit of a &#39;rewrite&#39;, but you could still use a fair amount of creative copying, pasting, searching and replacing to get it done.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Sat, 24 Mar 2007 18:56:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I use Julien Cugniere&#39;s dlg editor, which is actually very good. As good as the whole damn allegro gui system deserves. Worth its price, like Gimp. The editor does some nice things, it aligns all dialog entries nicely, you can muve each entry up or down in the struct (changing draw order), it draws even rects for custom procs. But when changing the order, you have to figure out the new indices and change your code manually. And that&#39;s the pain.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Sat, 24 Mar 2007 21:59:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did I mention that I have clear_keybuf() in almost every function? For some reason I couldn&#39;t get the dialouge to work any other way (the game would immediately read a second keypress and close the dialouge before the player could read it.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Tue, 27 Mar 2007 02:06:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are you using key[] to check for your keys? All you&#39;re doing there is reading from an array, without changing its contents. The key[] array is the status of each key: whether it&#39;s held or not.</p><p>If you are using Allegro&#39;s GUI, then that uses readkey() to detect its key-presses. You should consider whether readkey() is better for your purpose too. You can use readkey() to get a key from the buffer - and have it removed from the buffer so nothing else can read it again - and if you don&#39;t want the function to block, you can call keypressed() first to check whether there is a key in there. See the docs for more information.</p><p>If you indeed find that key[] is more appropriate, then why don&#39;t you call clear_keybuf() in just the right place, just before you show the dialogue?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Tue, 27 Mar 2007 02:50:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Possumdude0: It is because your code is a mess. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 27 Mar 2007 02:53:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ta gueule.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Tue, 27 Mar 2007 03:17:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>clear_keybuf doesn&#39;t touch the key array. It just clears the keypressed/readkey queue. The only (valid) way to modify the key array is to press or release a key on your keyboard.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Tue, 27 Mar 2007 03:19:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Ta gueule.
</p></div></div><p>

Tu peux la fermer? <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /></p><p>Don&#39;t re-write old code. Write it correctly in the first place. If it turns out not to be flexible or adaptable enough then you&#39;ll have to redesign it from scratch. </p><p>edit: damn my post button skills are too fast!<br />I forgot to add that if you have crappy code, or you try to extend it too many times you could end up with vista! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Goalie Ca)</author>
		<pubDate>Tue, 27 Mar 2007 09:25:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If it turns out not to be flexible or adaptable enough then you&#39;ll have to redesign it from scratch.
</p></div></div><p>That is what is implied by &quot;rewriting old code&quot;. You would NEVER rewrite an app the same way twice. Unless it was a perfectly coded piece of ART that you somehow lost the source to.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 27 Mar 2007 09:26:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It has a rather large allegro dialog struct and the indices are somehow wrong. Months ago I added something to the dialog and never got it ready. Now I need to make it ready and I have a hard time debugging it. It compiles and runs, but doesn&#39;t do the thing it should. And it is because indices are wrong.
</p></div></div><p>

I use defines for this, although enums would be better (I have been doing this since before I knew C thoroughly)  This list of defines (or enum) needs to kept manually in sync with changes to the dialog, but it saves shlepping through the rest of the code.  Hopefully, the dialog editor in DevAlleg will automatically maintain this list by associating the &#39;ID&#39; with the relevant index.  This has stalled because I want to parse the entire file for everything, because dlg&#39;s way of doing it does not preserve comments etc., and does not have automatic run-time initialisation code refactoring.</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>&#160;</td></tr><tr><td class="number">2</td><td><a href="http://www.allegro.cc/manual/DIALOG" target="_blank"><span class="a">DIALOG</span></a> prjopts_dialog<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span></td></tr><tr><td class="number">3</td><td><span class="k2">{</span></td></tr><tr><td class="number">4</td><td>   <span class="c">/* (dialog proc)     (x)   (y)   (w)   (h)   (fg)  (bg)  (key) (flags)  (d1)  (d2)  (dp) */</span></td></tr><tr><td class="number">5</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>,  <span class="n">0</span>,    <span class="n">0</span>,   <span class="n">600</span>,  <span class="n">400</span>,    <span class="n">255</span>,  <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,       <span class="n">0</span>,    <span class="n">0</span>,    NULL <span class="k2">}</span>,</td></tr><tr><td class="number">6</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_ctext_proc" target="_blank"><span class="a">d_ctext_proc</span></a>,       <span class="n">300</span>,  <span class="n">4</span>,   <span class="n">200</span>, <span class="n">16</span>,      <span class="n">255</span>,  <span class="n">1</span>,    <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Project Options"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">7</td><td>&#160;</td></tr><tr><td class="number">8</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">20</span>,  <span class="n">17</span>, <span class="n">130</span>, <span class="n">10</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>, <span class="n">0</span>,     <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Project "</span> <span class="k2">}</span>,</td></tr><tr><td class="number">9</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_list_proc" target="_blank"><span class="a">d_list_proc</span></a>,       <span class="n">84</span>,   <span class="n">14</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>, D_EXIT, <span class="n">0</span>, <span class="n">0</span>, <span class="k3">&amp;</span>project_name_getter<span class="k2">}</span>,</td></tr><tr><td class="number">10</td><td>&#160;</td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td>   <span class="k2">{</span> mage_tabbar_proc,  <span class="n">10</span>,    <span class="n">30</span>,  <span class="n">580</span>,  <span class="n">350</span>,    <span class="n">12</span>,  <span class="n">66</span>,   <span class="n">0</span>,    <span class="n">0</span>,       <span class="n">0</span>,    <span class="n">0</span>,    <span class="k3">&amp;</span>dev1_prjopts_tabbar<span class="k2">}</span>,    <span class="c">/* 1 */</span></td></tr><tr><td class="number">13</td><td>&#160;</td></tr><tr><td class="number">14</td><td>   <span class="k2">{</span> mage_button_proc,     <span class="n">400</span>,   <span class="n">384</span>,  _WB,  _HB,  <span class="n">255</span>,  <span class="n">12</span>,     <span class="s">'c'</span>,   D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"&amp;Cancel"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">15</td><td>   <span class="k2">{</span> mage_button_proc,     <span class="n">500</span>,   <span class="n">384</span>,  _WB,  _HB,  <span class="n">255</span>,  <span class="n">12</span>,     <span class="s">'o'</span>,   D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"OK"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td><span class="c">/* General Tab */</span></td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td>&#160;</td></tr><tr><td class="number">22</td><td><span class="c">/* Directories Tab */</span></td></tr><tr><td class="number">23</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">24</td><td>&#160;</td></tr><tr><td class="number">25</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">50</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>, <span class="n">0</span>,     <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Project name"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">26</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,   <span class="n">50</span>, <span class="n">400</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>, <span class="n">0</span>,     <span class="k1">sizeof</span><span class="k2">(</span>prjo_name<span class="k2">)</span>,<span class="n">0</span>,prjo_name<span class="k2">}</span>,</td></tr><tr><td class="number">27</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,    <span class="n">440</span>,  <span class="n">60</span>, <span class="n">80</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">28</td><td>&#160;</td></tr><tr><td class="number">29</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">80</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>, <span class="n">0</span>,     <span class="n">0</span>, <span class="n">0</span>, <span class="s">"File"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">30</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,   <span class="n">90</span>, <span class="n">400</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>, <span class="n">0</span>,     <span class="k1">sizeof</span><span class="k2">(</span>prjo_fname<span class="k2">)</span>,<span class="n">0</span>,prjo_fname<span class="k2">}</span>,</td></tr><tr><td class="number">31</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,    <span class="n">440</span>,  <span class="n">90</span>, <span class="n">80</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">32</td><td>&#160;</td></tr><tr><td class="number">33</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>, <span class="n">110</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,  <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Working Directory"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">34</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,  <span class="n">120</span>, <span class="n">400</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,  <span class="n">0</span>,    <span class="k1">sizeof</span><span class="k2">(</span>prjo_workingdir<span class="k2">)</span>,<span class="n">0</span>,prjo_workingdir<span class="k2">}</span>,</td></tr><tr><td class="number">35</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,    <span class="n">440</span>, <span class="n">120</span>, <span class="n">80</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT, <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">36</td><td>&#160;</td></tr><tr><td class="number">37</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>, <span class="n">140</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,  <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Local Root"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">38</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,  <span class="n">150</span>, <span class="n">400</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,  <span class="n">0</span>,    <span class="k1">sizeof</span><span class="k2">(</span>prjo_localroot<span class="k2">)</span>,<span class="n">0</span>,prjo_localroot<span class="k2">}</span>,</td></tr><tr><td class="number">39</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,    <span class="n">440</span>, <span class="n">150</span>, <span class="n">80</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT, <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">40</td><td>&#160;</td></tr><tr><td class="number">41</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_textbox_proc" target="_blank"><span class="a">d_textbox_proc</span></a>,    <span class="n">80</span>,  <span class="n">180</span>, <span class="n">200</span>, <span class="n">120</span>,  <span class="n">12</span>, <span class="n">66</span>,   <span class="n">0</span>,  <span class="n">0</span>,       <span class="n">0</span>, <span class="n">0</span>, dev1prjo_target_text<span class="k2">}</span>,</td></tr><tr><td class="number">42</td><td>&#160;</td></tr><tr><td class="number">43</td><td>&#160;</td></tr><tr><td class="number">44</td><td><span class="c">/* Compilers Tab */</span></td></tr><tr><td class="number">45</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">46</td><td>&#160;</td></tr><tr><td class="number">47</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_list_proc" target="_blank"><span class="a">d_list_proc</span></a>,       <span class="n">80</span>,   <span class="n">50</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">12</span>, <span class="n">66</span>,     <span class="n">0</span>,  <span class="n">0</span>,  <span class="n">0</span>, <span class="n">0</span>, <span class="k3">&amp;</span>edit_filetype_getter<span class="k2">}</span>,</td></tr><tr><td class="number">48</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_list_proc" target="_blank"><span class="a">d_list_proc</span></a>,       <span class="n">80</span>,   <span class="n">70</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>, D_EXIT, <span class="n">0</span>, <span class="n">0</span>, <span class="k3">&amp;</span>mage_fontname_getter<span class="k2">}</span>,</td></tr><tr><td class="number">49</td><td>&#160;</td></tr><tr><td class="number">50</td><td>&#160;</td></tr><tr><td class="number">51</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">160</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'r'</span>,D_EXIT,  <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"show &amp;ruler"</span><span class="k2">}</span>,</td></tr><tr><td class="number">52</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">170</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'t'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"show &amp;tabs"</span><span class="k2">}</span>,</td></tr><tr><td class="number">53</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">180</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'s'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"tabs to spaces"</span><span class="k2">}</span>,</td></tr><tr><td class="number">54</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">190</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'l'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"show &amp;linefeed"</span><span class="k2">}</span>,</td></tr><tr><td class="number">55</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">200</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'e'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"show lin&amp;ewrap"</span><span class="k2">}</span>,</td></tr><tr><td class="number">56</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">210</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'w'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"show &amp;wordwrap"</span><span class="k2">}</span>,</td></tr><tr><td class="number">57</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">220</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'n'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"show line &amp;numbers"</span><span class="k2">}</span>,</td></tr><tr><td class="number">58</td><td>&#160;</td></tr><tr><td class="number">59</td><td><span class="c">/* Data Tab */</span></td></tr><tr><td class="number">60</td><td>&#160;</td></tr><tr><td class="number">61</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">62</td><td>&#160;</td></tr><tr><td class="number">63</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,          <span class="n">30</span>, <span class="n">50</span>, <span class="n">140</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Data Plugins"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">64</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">60</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'d'</span>,D_EXIT,  <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"&amp;dialog editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">65</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">70</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'m'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"&amp;menu editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">66</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">80</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'b'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"&amp;bitmap editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">67</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">90</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'t'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"&amp;toolbar editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">68</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">100</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'w'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"dra&amp;wing editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">69</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">110</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'h'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"&amp;html editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">70</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">120</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'a'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"&amp;audio editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">71</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">130</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'u'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"d&amp;uh editor"</span><span class="k2">}</span>,</td></tr><tr><td class="number">72</td><td>&#160;</td></tr><tr><td class="number">73</td><td>&#160;</td></tr><tr><td class="number">74</td><td><span class="c">/* Libraries Tab */</span></td></tr><tr><td class="number">75</td><td>&#160;</td></tr><tr><td class="number">76</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">77</td><td>&#160;</td></tr><tr><td class="number">78</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">50</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Libraries"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">79</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,   <span class="n">60</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,    <span class="n">0</span>,  <span class="k1">sizeof</span><span class="k2">(</span>target_pathname<span class="k2">)</span>,<span class="n">0</span>, target_pathname<span class="k2">}</span>,</td></tr><tr><td class="number">80</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,    <span class="n">440</span>,  <span class="n">60</span>, <span class="n">80</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">81</td><td>&#160;</td></tr><tr><td class="number">82</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">80</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Linker Options"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">83</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,   <span class="n">90</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,    <span class="n">0</span>,  <span class="k1">sizeof</span><span class="k2">(</span>target_pathname<span class="k2">)</span>,<span class="n">0</span>, target_pathname<span class="k2">}</span>,</td></tr><tr><td class="number">84</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,    <span class="n">440</span>,  <span class="n">90</span>, <span class="n">80</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">85</td><td>&#160;</td></tr><tr><td class="number">86</td><td>&#160;</td></tr><tr><td class="number">87</td><td><span class="c">/* Libraries Tab */</span></td></tr><tr><td class="number">88</td><td>&#160;</td></tr><tr><td class="number">89</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">90</td><td>&#160;</td></tr><tr><td class="number">91</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">50</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Libraries"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">92</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,   <span class="n">60</span>, <span class="n">400</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,    <span class="n">0</span>,  <span class="k1">sizeof</span><span class="k2">(</span>prjo_libs<span class="k2">)</span>,<span class="n">0</span>, prjo_libs<span class="k2">}</span>,</td></tr><tr><td class="number">93</td><td>   <span class="k2">{</span> mage_button_proc,    <span class="n">440</span>,  <span class="n">60</span>, <span class="n">48</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">94</td><td>&#160;</td></tr><tr><td class="number">95</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">80</span>, <span class="n">130</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Linker Options"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">96</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">30</span>,   <span class="n">90</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,    <span class="n">0</span>,  <span class="k1">sizeof</span><span class="k2">(</span>prjo_linkopts<span class="k2">)</span>,<span class="n">0</span>, prjo_linkopts<span class="k2">}</span>,</td></tr><tr><td class="number">97</td><td>   <span class="k2">{</span> mage_button_proc,    <span class="n">440</span>,  <span class="n">90</span>, <span class="n">48</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">98</td><td>&#160;</td></tr><tr><td class="number">99</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">110</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'s'</span>,D_EXIT,  <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"Link with Standard Libs"</span><span class="k2">}</span>,</td></tr><tr><td class="number">100</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">120</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'a'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"Link with Allegro 4"</span><span class="k2">}</span>,</td></tr><tr><td class="number">101</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">130</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'g'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"Link with AllegroGL"</span><span class="k2">}</span>,</td></tr><tr><td class="number">102</td><td>   <span class="k2">{</span> mage_check_proc,       <span class="n">40</span>,<span class="n">140</span>,<span class="n">120</span>,<span class="n">10</span>,  <span class="n">255</span>,<span class="n">0</span>, <span class="s">'m'</span>,D_EXIT,   <span class="n">1</span>, <span class="n">0</span> ,  <span class="s">"Link with Mage"</span><span class="k2">}</span>,</td></tr><tr><td class="number">103</td><td>&#160;</td></tr><tr><td class="number">104</td><td>&#160;</td></tr><tr><td class="number">105</td><td><span class="c">/* Target Tab */</span></td></tr><tr><td class="number">106</td><td>&#160;</td></tr><tr><td class="number">107</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_shadow_box_proc" target="_blank"><span class="a">d_shadow_box_proc</span></a>, <span class="n">20</span>,   <span class="n">44</span>,  <span class="n">560</span>, <span class="n">330</span>, <span class="n">255</span>,  <span class="n">0</span>,  <span class="n">0</span>,     <span class="n">0</span>,    <span class="n">0</span>,  <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">108</td><td>&#160;</td></tr><tr><td class="number">109</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_textbox_proc" target="_blank"><span class="a">d_textbox_proc</span></a>,    <span class="n">80</span>,  <span class="n">120</span>, <span class="n">200</span>, <span class="n">120</span>,  <span class="n">12</span>, <span class="n">66</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, dev1prjo_target_text<span class="k2">}</span>,</td></tr><tr><td class="number">110</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">50</span>, <span class="n">140</span>, <span class="n">16</span>,   <span class="n">255</span>,<span class="n">1</span>,    <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Target Type"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">111</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_list_proc" target="_blank"><span class="a">d_list_proc</span></a>,      <span class="n">160</span>,   <span class="n">50</span>, <span class="n">200</span>, <span class="n">16</span>,   <span class="n">255</span>,<span class="n">0</span>,  <span class="n">0</span>, D_EXIT,  <span class="n">0</span>, <span class="n">0</span>, <span class="k3">&amp;</span>target_filetype_getter<span class="k2">}</span>,</td></tr><tr><td class="number">112</td><td>&#160;</td></tr><tr><td class="number">113</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">70</span>, <span class="n">140</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Filename"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">114</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,      <span class="n">160</span>,   <span class="n">70</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,   <span class="n">0</span>,  <span class="k1">sizeof</span><span class="k2">(</span>prjo_target_fname<span class="k2">)</span>,<span class="n">0</span>, prjo_target_fname<span class="k2">}</span>,</td></tr><tr><td class="number">115</td><td>   <span class="k2">{</span> mage_button_proc,    <span class="n">440</span>,  <span class="n">70</span>, <span class="n">48</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">116</td><td>&#160;</td></tr><tr><td class="number">117</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_text_proc" target="_blank"><span class="a">d_text_proc</span></a>,       <span class="n">30</span>,  <span class="n">90</span>, <span class="n">140</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">1</span>,   <span class="n">0</span>,    <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="s">"Icon"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">118</td><td>   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,      <span class="n">160</span>,   <span class="n">90</span>, <span class="n">200</span>, <span class="n">16</span>, <span class="n">255</span>,<span class="n">0</span>,   <span class="n">0</span>,   <span class="n">0</span>,  <span class="k1">sizeof</span><span class="k2">(</span>prjo_icon_fname<span class="k2">)</span>,<span class="n">0</span>, prjo_icon_fname<span class="k2">}</span>,</td></tr><tr><td class="number">119</td><td>   <span class="k2">{</span> mage_button_proc,    <span class="n">440</span>,  <span class="n">90</span>, <span class="n">48</span>,  <span class="n">16</span>, <span class="n">255</span>,<span class="n">12</span>,<span class="s">'o'</span>,D_EXIT,  <span class="n">0</span>,    <span class="n">0</span>, <span class="s">"browse"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">120</td><td>&#160;</td></tr><tr><td class="number">121</td><td>&#160;</td></tr><tr><td class="number">122</td><td>   <span class="k2">{</span> NULL,              <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,      <span class="n">0</span>,  <span class="n">0</span>,   <span class="n">0</span>,    <span class="n">0</span>,       <span class="n">0</span>,    <span class="n">0</span>,    NULL <span class="k2">}</span></td></tr><tr><td class="number">123</td><td><span class="k2">}</span><span class="k2">;</span></td></tr><tr><td class="number">124</td><td>&#160;</td></tr><tr><td class="number">125</td><td>&#160;</td></tr><tr><td class="number">126</td><td>&#160;</td></tr><tr><td class="number">127</td><td><span class="p">#define PRJOPTS_CANCEL_BUTTON 3</span></td></tr><tr><td class="number">128</td><td>&#160;</td></tr><tr><td class="number">129</td><td><span class="p">#define PRJO_GEN_PANE 7</span></td></tr><tr><td class="number">130</td><td><span class="p">#define PRJO_DIR_PANE 8</span></td></tr><tr><td class="number">131</td><td><span class="p">#define PRJO_BROWSE_FILENAME 14</span></td></tr><tr><td class="number">132</td><td><span class="p">#define PRJO_BROWSE_WORKINGDIR 17</span></td></tr><tr><td class="number">133</td><td><span class="p">#define PRJO_BROWSE_LOCALROOT 20</span></td></tr><tr><td class="number">134</td><td>&#160;</td></tr><tr><td class="number">135</td><td><span class="p">#define PRJO_CMP_PANE 22</span></td></tr><tr><td class="number">136</td><td><span class="p">#define PRJO_LINK_PANE 32</span></td></tr><tr><td class="number">137</td><td><span class="p">#define PRJO_GFX_PANE 42</span></td></tr><tr><td class="number">138</td><td><span class="p">#define PRJO_SOUND_PANE 49</span></td></tr><tr><td class="number">139</td><td>&#160;</td></tr><tr><td class="number">140</td><td><span class="p">#define PRJO_TARGET_PANE 60</span></td></tr><tr><td class="number">141</td><td><span class="p">#define PRJO_BROWSE_TARGET 66</span></td></tr><tr><td class="number">142</td><td><span class="p">#define PRJO_BROWSE_ICON 69</span></td></tr><tr><td class="number">143</td><td>&#160;</td></tr><tr><td class="number">144</td><td><span class="p">#define PRJO_E_PANE 70</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matt Smith)</author>
		<pubDate>Tue, 27 Mar 2007 11:21:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I use defines for this, although enums would be better (I have been doing this since before I knew C thoroughly) This list of defines (or enum) needs to kept manually in sync with changes to the dialog, but it saves shlepping through the rest of the code.
</p></div></div><p>
This is what I do in my ogg_encoder tool for apeg (which relies quite a bit on object &quot;positions&quot;).
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">static</span> <a href="http://www.allegro.cc/manual/DIALOG" target="_blank"><span class="a">DIALOG</span></a> main_dialog<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span></td></tr><tr><td class="number">2</td><td><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_clear_proc, .w<span class="k3">=</span>SW, .h<span class="k3">=</span>SH <span class="k2">}</span>,</td></tr><tr><td class="number">4</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_menu_proc, .x<span class="k3">=</span><span class="k3">-</span><span class="n">1</span>, .y<span class="k3">=</span><span class="k3">-</span><span class="n">1</span>, .dp<span class="k3">=</span>main_menu <span class="k2">}</span>,</td></tr><tr><td class="number">5</td><td><span class="p">#define ENCODE_BTN      2</span></td></tr><tr><td class="number">6</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_button_proc, .x<span class="k3">=</span>SW<span class="k3">/</span><span class="n">4</span><span class="k3">-</span><span class="n">32</span>, .y<span class="k3">=</span><span class="n">448</span>, .w<span class="k3">=</span><span class="n">64</span>, .h<span class="k3">=</span><span class="n">16</span>, .flags<span class="k3">=</span>D_EXIT, .dp<span class="k3">=</span><span class="s">"Encode"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">7</td><td><span class="p">#define TEST_BTN        (ENCODE_BTN+1)</span></td></tr><tr><td class="number">8</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_push_proc, .x<span class="k3">=</span>SW<span class="k3">*</span><span class="n">2</span><span class="k3">/</span><span class="n">4</span><span class="k3">-</span><span class="n">32</span>, .y<span class="k3">=</span><span class="n">448</span>, .w<span class="k3">=</span><span class="n">64</span>, .h<span class="k3">=</span><span class="n">16</span>, .dp<span class="k3">=</span><span class="s">"Test"</span>, .dp3<span class="k3">=</span>simple_player</td></tr><tr><td class="number">9</td><td> <span class="k2">}</span>,</td></tr><tr><td class="number">10</td><td><span class="p">#define CANCEL_BTN      (TEST_BTN+1)</span></td></tr><tr><td class="number">11</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_push_proc, .x<span class="k3">=</span>SW<span class="k3">*</span><span class="n">3</span><span class="k3">/</span><span class="n">4</span><span class="k3">-</span><span class="n">32</span>, .y<span class="k3">=</span><span class="n">448</span>, .w<span class="k3">=</span><span class="n">64</span>, .h<span class="k3">=</span><span class="n">16</span>, .dp<span class="k3">=</span><span class="s">"Quit"</span>, .dp3<span class="k3">=</span>quit <span class="k2">}</span>,</td></tr><tr><td class="number">12</td><td><span class="p">#define MAIN_AREA_END (CANCEL_BTN)</span></td></tr><tr><td class="number">13</td><td>&#160;</td></tr><tr><td class="number">14</td><td><span class="p">#define VIDEO_AREA_START (MAIN_AREA_END+1)</span></td></tr><tr><td class="number">15</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_window_proc, .x<span class="k3">=</span><span class="n">6</span>, .y<span class="k3">=</span><span class="n">16</span>, .w<span class="k3">=</span><span class="n">628</span>, .h<span class="k3">=</span><span class="n">164</span>, .dp<span class="k3">=</span><span class="s">"Video Options"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">16</td><td><span class="p">#define VIDEO_RADIO_BTN(x)      (VIDEO_AREA_START+1+(x))</span></td></tr><tr><td class="number">17</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_radio_proc, .x<span class="k3">=</span><span class="n">14</span>, .y<span class="k3">=</span><span class="n">40</span>, .w<span class="k3">=</span><span class="n">96</span>, .h<span class="k3">=</span><span class="n">10</span>, .d1<span class="k3">=</span><span class="n">1</span>, .flags<span class="k3">=</span>D_EXIT,</td></tr><tr><td class="number">18</td><td>          .dp<span class="k3">=</span><span class="s">"Video file"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">19</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_radio_proc, .x<span class="k3">=</span><span class="n">120</span>, .y<span class="k3">=</span><span class="n">40</span>, .w<span class="k3">=</span><span class="n">96</span>, .h<span class="k3">=</span><span class="n">10</span>, .d1<span class="k3">=</span><span class="n">1</span>,</td></tr><tr><td class="number">20</td><td>          .flags<span class="k3">=</span>D_EXIT, .dp<span class="k3">=</span><span class="s">"Video pipe"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">21</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_radio_proc, .x<span class="k3">=</span><span class="n">224</span>, .y<span class="k3">=</span><span class="n">40</span>, .w<span class="k3">=</span><span class="n">120</span>, .h<span class="k3">=</span><span class="n">10</span>, .d1<span class="k3">=</span><span class="n">1</span>,</td></tr><tr><td class="number">22</td><td>          .flags<span class="k3">=</span>D_SELECTED<span class="k3">|</span>D_EXIT, .dp<span class="k3">=</span><span class="s">"Disable Video"</span> <span class="k2">}</span>,</td></tr><tr><td class="number">23</td><td><span class="p">#define VIDEO_BROWSE_BTN        (VIDEO_RADIO_BTN(0)+3)</span></td></tr><tr><td class="number">24</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_push_proc, .x<span class="k3">=</span><span class="n">28</span><span class="k3">+</span><span class="n">522</span>, .y<span class="k3">=</span><span class="n">53</span>, .w<span class="k3">=</span><span class="n">64</span>, .h<span class="k3">=</span><span class="n">16</span>,</td></tr><tr><td class="number">25</td><td>          .flags<span class="k3">=</span>D_DISABLED, .dp<span class="k3">=</span><span class="s">"Browse"</span>, .dp3<span class="k3">=</span>file_browser <span class="k2">}</span>,</td></tr><tr><td class="number">26</td><td>        <span class="k2">{</span> .proc<span class="k3">=</span>d_agup_edit_proc, .x<span class="k3">=</span><span class="n">32</span>, .y<span class="k3">=</span><span class="n">54</span>, .w<span class="k3">=</span><span class="n">522</span><span class="k3">-</span><span class="n">8</span>, .h<span class="k3">=</span><span class="n">14</span>, .flags<span class="k3">=</span>D_DISABLED,</td></tr><tr><td class="number">27</td><td>          .d1<span class="k3">=</span><span class="k1">sizeof</span><span class="k2">(</span>video_fname<span class="k2">)</span><span class="k3">-</span><span class="n">1</span>, .dp<span class="k3">=</span>video_fname <span class="k2">}</span>,</td></tr><tr><td class="number">28</td><td>...</td></tr></tbody></table></div></div><p>
That way if I add or remove a widget, I just need to modify the one macro below it, and all the macros in the dialog remain in sync.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Tue, 27 Mar 2007 11:40:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Bruce Perry said:</div><div class="quote"><p>

Ta gueule.
</p></div></div><p>
Hey Bruce, do you have a problem ? Even if is your French is good, it is not good enough to crush me at French bashing, baby <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> . </p><p>Now, for your French practicing, a little bit of informations:<br /> <i>Reste cool, je n&#39;ai agressé personne. Quand bien même PossumDude0 se sentirais blessé, se serait à lui de le montrer, et non à toi. &quot;Ta Gueule&quot; est une expression qui est loin d&#39;être poli. A la limite tu aurais posté un &quot;Ta Gull&quot; et cela aurait pu passer pour une taquinerie.

Pour ta culture personnelle, la définition suivante convient parfaitement au mot poli:
Dont le comportement, les manières, le langage sont conformes aux règles de la bienséance, au respect des convenances.

Ce qui est loin d&#39;être le cas de ta remarque.</i></p><div class="quote_container"><div class="title">Goalie Ca said:</div><div class="quote"><p>

Tu peux la fermer? <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" />
</p></div></div><p>
That is the difference between the French and Canadian speak ;-) You Canadian are more courteous than us the French ;-) ( and even more courteous than people learning French. )</p><p>Mark Oates: sorry. I did not want to derail the thread.</p><p>PossumDude0: Were you really shocked ? If so I tell you now there was no reason as it was joking. If not, heh, have a nice day.</p><p> <u>Now, back on the thread rail:</u><br />As Johan, I am also using dlg from Julien Cugnieres, it fits my needs perfectly.<br />You should really give it a try.</p><p>EDIT:<br />A simple copy-paste in a file with Matt dialog give me this:<br /> <span class="remote-thumbnail"><span class="json">{"name":"591667","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/b\/2bc4bad99c0f4f66dfa4785659d86082.jpg","w":646,"h":505,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/b\/2bc4bad99c0f4f66dfa4785659d86082"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/2/b/2bc4bad99c0f4f66dfa4785659d86082-240.jpg" alt="591667" width="240" height="187" /></span><br />_
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 27 Mar 2007 14:00:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Whoa. All that reply to a post with two words in it! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /></p><p>Your post just didn&#39;t seem funny. It seemed little more than an insult. If I can take it wrongly, then a lot of people could. It was worth my posting that, because now it&#39;s painfully clear you meant it as a joke <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>(I wondered if you were going to flaunt your native French at me <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Wed, 28 Mar 2007 03:54:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In canada we have a saying for &quot;english people&quot; who just don&#39;t get it...</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Tête-Carré
</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Goalie Ca)</author>
		<pubDate>Wed, 28 Mar 2007 09:01:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My my my, Bruce. We misunderstood each other ! <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" /></p><p>Lets say it is OK now <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>While I wrote my answer I was remembering the long talk we had on irc some times ago, and your post made me a little bit angry ( as I was really joking PossumDude0 this time ).</p><p>Bwahbwahbwahbwah, everything is under control now :-)</p><p><img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Wed, 28 Mar 2007 11:46:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just noticed something in my code. It looks like KEY_PLUS_PAD will decrease the speed, and KEY_MINUS_PAD will increase it!?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Fri, 30 Mar 2007 19:19:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It is quite logical in my oppinion, you are changing friction. When you lessen the friction your whatever_it_is will move faster.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HoHo)</author>
		<pubDate>Fri, 30 Mar 2007 19:21:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh yeah, I was decreasing the delay, which increased the speed... brain fart!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Fri, 30 Mar 2007 19:39:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Halflife sourcecode:<br />float m_frictionFraction;   // Sorry, couldn&#39;t resist this name <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />dlls\triggers.cpp (line 56)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Sat, 31 Mar 2007 02:20:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>PossumDude - do you not know how to clean up after yourself? Your program seems to leak a nice chunk of memory, depending on the size of those bitmaps.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Sat, 31 Mar 2007 02:30:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1) I don&#39;t really understand what leaking memory is, but I can tell it&#39;s important and I need to learn it, it&#39;s Google-time!</p><p>2) That program, as I have already stated, need rewriting. It is also unfinished, because they cut off my electricity when I had barely gotten things displaying properly. But I&#39;m getting my electicity back on next week! I hope...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Black)</author>
		<pubDate>Sat, 31 Mar 2007 23:50:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Memory leaks when memory is reserved by a program and never released back to the operating system. <s>When the program closes the operating system doesn&#39;t know the memory is free so it will not give it to another program. That memory is essentially unusable until the computer restarts (or possible the operating system determines that it&#39;s not in use, but I don&#39;t think this happens).</s></p><p> <i>**See following posts**</i></p><p>In other words, when you create a variable in your program, your program has to request memory from the operating system, which controls the entire computer. If it has the memory available it will probably grant it to you. If not, depending on the system, it will probably somehow message your program to indicate that there isn&#39;t enough memory. If your program doesn&#39;t handle this (probably an exception) your program will otherwise crash.</p><p>Once the operating system grants your program access to memory no other program should be allowed to use it (that is dependent on the operating system, but I assume XP or Vista do this; and I&#39;m very certain that *nix systems do). That will ensure that another program doesn&#39;t overwrite a variable on you and mess up your program.</p><p>When your program is finished with memory, it should release it so the operating system can give it to some other program.</p><p>A simple example:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">class</span> Object</td></tr><tr><td class="number">2</td><td><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>private:</td></tr><tr><td class="number">4</td><td>    <span class="k1">int</span> mintX<span class="k2">;</span></td></tr><tr><td class="number">5</td><td>    <span class="k1">int</span> mintY<span class="k2">;</span></td></tr><tr><td class="number">6</td><td>public:</td></tr><tr><td class="number">7</td><td>    <span class="k1">int</span> X<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span></td></tr><tr><td class="number">8</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">9</td><td>        <span class="k1">return</span> mintX<span class="k2">;</span></td></tr><tr><td class="number">10</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td>    <span class="k1">void</span> X<span class="k2">(</span><span class="k1">int</span> intX<span class="k2">)</span></td></tr><tr><td class="number">13</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">14</td><td>        mintX <span class="k3">=</span> intX<span class="k2">;</span></td></tr><tr><td class="number">15</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>    <span class="k1">int</span> Y<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span></td></tr><tr><td class="number">18</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">19</td><td>        <span class="k1">return</span> mintY<span class="k2">;</span></td></tr><tr><td class="number">20</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">21</td><td>&#160;</td></tr><tr><td class="number">22</td><td>    <span class="k1">void</span> Y<span class="k2">(</span><span class="k1">int</span> intY<span class="k2">)</span></td></tr><tr><td class="number">23</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">24</td><td>        mintY <span class="k3">=</span> intY<span class="k2">;</span></td></tr><tr><td class="number">25</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">26</td><td><span class="k2">}</span></td></tr><tr><td class="number">27</td><td>&#160;</td></tr><tr><td class="number">28</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span></td></tr><tr><td class="number">29</td><td><span class="k2">{</span></td></tr><tr><td class="number">30</td><td>    <span class="k1">int</span> <span class="k3">*</span>intPointer <span class="k3">=</span> NULL<span class="k2">;</span>     <span class="c">// Stores a memory address, not an int.</span></td></tr><tr><td class="number">31</td><td>    Object <span class="k3">*</span>objPointer <span class="k3">=</span> NULL<span class="k2">;</span>  <span class="c">// Stores a memory address, not an Object.</span></td></tr><tr><td class="number">32</td><td>&#160;</td></tr><tr><td class="number">33</td><td>    intPointer <span class="k3">=</span> <span class="k1">new</span> <span class="k1">int</span><span class="k2">[</span><span class="n">1</span><span class="k2">]</span><span class="k2">;</span>    <span class="c">// Create a new int and point to it with intPointer.</span></td></tr><tr><td class="number">34</td><td>    objPointer <span class="k3">=</span> <span class="k1">new</span> Object<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>  <span class="c">// Create a new Object and point to it with objPointer.</span></td></tr><tr><td class="number">35</td><td>&#160;</td></tr><tr><td class="number">36</td><td>    <span class="c">/*</span></td></tr><tr><td class="number">37</td><td><span class="c">     *  What we have done is create two variables that store memory addresses. Then</span></td></tr><tr><td class="number">38</td><td><span class="c">     *  we instantiated an int and an Object and stored their memory addresses in</span></td></tr><tr><td class="number">39</td><td><span class="c">     *  intPointer and objPointer. If we refer to intPointer we are actually going</span></td></tr><tr><td class="number">40</td><td><span class="c">     *  to be getting a memory address, not the integer it points to. However, if</span></td></tr><tr><td class="number">41</td><td><span class="c">     *  we use the * operator with it, which translates to "the value pointed to</span></td></tr><tr><td class="number">42</td><td><span class="c">     *  by" we can access the actual integer. Therefore, *intPointer becomes "value </span></td></tr><tr><td class="number">43</td><td><span class="c">     *  pointed to by intPointer".</span></td></tr><tr><td class="number">44</td><td><span class="c">     */</span></td></tr><tr><td class="number">45</td><td>    <span class="k3">*</span>intPointer <span class="k3">=</span> <span class="n">5</span><span class="k2">;</span>  <span class="c">// Store 5 in the memory space pointed to by intPointer.</span></td></tr><tr><td class="number">46</td><td>&#160;</td></tr><tr><td class="number">47</td><td>    <span class="c">/*</span></td></tr><tr><td class="number">48</td><td><span class="c">     *  With objPointer we can reference it and it's properties the same way. For</span></td></tr><tr><td class="number">49</td><td><span class="c">     *  example, *objPointer.X() would return the value stored in mintX of</span></td></tr><tr><td class="number">50</td><td><span class="c">     *  our Object instance, which is pointed to by objPointer. We can also use the </span></td></tr><tr><td class="number">51</td><td><span class="c">     *  -&gt; operator to get access to the members and methods of an object pointer,</span></td></tr><tr><td class="number">52</td><td><span class="c">     *  which will allow us to avoid using *. For example, objPointer-&gt;X() is the</span></td></tr><tr><td class="number">53</td><td><span class="c">     *  same as *objPointer.X().</span></td></tr><tr><td class="number">54</td><td><span class="c">     */</span></td></tr><tr><td class="number">55</td><td>&#160;</td></tr><tr><td class="number">56</td><td>    <span class="c">/*</span></td></tr><tr><td class="number">57</td><td><span class="c">     *  Set the mintX property of the Object instance pointed to by objPointer to</span></td></tr><tr><td class="number">58</td><td><span class="c">     *  5. Set the mintY property of the Object instance pointed to by objPointer</span></td></tr><tr><td class="number">59</td><td><span class="c">     *  to 3.</span></td></tr><tr><td class="number">60</td><td><span class="c">     */</span></td></tr><tr><td class="number">61</td><td>    <span class="k3">*</span>objPointer.X<span class="k2">(</span><span class="n">5</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">62</td><td>    <span class="k3">*</span>objPointer.Y<span class="k2">(</span><span class="n">3</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">63</td><td>&#160;</td></tr><tr><td class="number">64</td><td>    <span class="c">/*</span></td></tr><tr><td class="number">65</td><td><span class="c">     *  Set the mintX property of the Object instance pointed to by objPointer to</span></td></tr><tr><td class="number">66</td><td><span class="c">     *  6, this time using the -&gt; operator instead of * and . operators. Set the</span></td></tr><tr><td class="number">67</td><td><span class="c">     *  mintY property of the Object instance pointed to by objPointer to 8, also</span></td></tr><tr><td class="number">68</td><td><span class="c">     *  using the -&gt; operator instead of * and . operators.</span></td></tr><tr><td class="number">69</td><td><span class="c">     */</span></td></tr><tr><td class="number">70</td><td>    objPointer-&gt;X<span class="k2">(</span><span class="n">6</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">71</td><td>    objPointer-&gt;Y<span class="k2">(</span><span class="n">8</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">72</td><td>&#160;</td></tr><tr><td class="number">73</td><td>    <span class="c">/*</span></td></tr><tr><td class="number">74</td><td><span class="c">     *  Now lets illustrate the point to be made: MEMORY LEAKS. When a variable</span></td></tr><tr><td class="number">75</td><td><span class="c">     *  goes out of scope (such as the end of a function or the program) there are</span></td></tr><tr><td class="number">76</td><td><span class="c">     *  instructions to release the memory used by your program. I assume the</span></td></tr><tr><td class="number">77</td><td><span class="c">     *  compiler takes care of this, but I'm not completely sure. Anyway, that is</span></td></tr><tr><td class="number">78</td><td><span class="c">     *  when memory used by your variables are released to the operating system.</span></td></tr><tr><td class="number">79</td><td><span class="c">     *  However, when a pointer is released the memory being released is the memory</span></td></tr><tr><td class="number">80</td><td><span class="c">     *  that holds the memory address of the data, not the actual data. As a</span></td></tr><tr><td class="number">81</td><td><span class="c">     *  result, the actual memory used to store the data is orphaned. The reference</span></td></tr><tr><td class="number">82</td><td><span class="c">     *  is released (the pointer) and that memory is unusable until the program</span></td></tr><tr><td class="number">83</td><td><span class="c">     *  exits.</span></td></tr><tr><td class="number">84</td><td><span class="c"></span></td></tr><tr><td class="number">85</td><td><span class="c">     *  Something to note is pointer scope: a pointer in a function will be</span></td></tr><tr><td class="number">86</td><td><span class="c">     *  released at the end of the function, which means you lose the address it</span></td></tr><tr><td class="number">87</td><td><span class="c">     *  points to and that memory is again "leaked". As a result, before your</span></td></tr><tr><td class="number">88</td><td><span class="c">     *  pointers go out of scope you should always release the data they point to,</span></td></tr><tr><td class="number">89</td><td><span class="c">     *  or pass the address somewhere else so you can continue to use it and</span></td></tr><tr><td class="number">90</td><td><span class="c">     *  release it later. Using malloc() to allocate your memory you should use</span></td></tr><tr><td class="number">91</td><td><span class="c">     *  free() to release it. Using the new operator to allocate your memory you</span></td></tr><tr><td class="number">92</td><td><span class="c">     *  should use the delete operator to release it.</span></td></tr><tr><td class="number">93</td><td><span class="c">     */</span></td></tr><tr><td class="number">94</td><td><span class="c">//  delete intPointer;   // Releases the memory pointed to by intPointer. I've</span></td></tr><tr><td class="number">95</td><td>                         <span class="c">// commented it out to actually illustrate a memory leak.</span></td></tr><tr><td class="number">96</td><td>    intPointer <span class="k3">=</span> NULL<span class="k2">;</span>   <span class="c">// We are overwriting the address with NULL (0 or \0) to</span></td></tr><tr><td class="number">97</td><td>                         <span class="c">// illustrate that is no longer in use. Doing this before</span></td></tr><tr><td class="number">98</td><td>                         <span class="c">// you release the data is bad because you're leaking that </span></td></tr><tr><td class="number">99</td><td>                         <span class="c">// memory. Because we have no other reference/pointer to</span></td></tr><tr><td class="number">100</td><td>                         <span class="c">// the instance and we never released it (because the</span></td></tr><tr><td class="number">101</td><td>                         <span class="c">// delete statement is commented out) we are causing a</span></td></tr><tr><td class="number">102</td><td>                         <span class="c">// memory leak.</span></td></tr><tr><td class="number">103</td><td>&#160;</td></tr><tr><td class="number">104</td><td>    <span class="k1">delete</span> objPointer<span class="k2">;</span>   <span class="c">// Releases the memory pointed to by objPointer.</span></td></tr><tr><td class="number">105</td><td>    objPointer <span class="k3">=</span> NULL<span class="k2">;</span>   <span class="c">// We can no longer use the address that it points to</span></td></tr><tr><td class="number">106</td><td>                         <span class="c">// because the operating system owns it again, so we set</span></td></tr><tr><td class="number">107</td><td>                         <span class="c">// it to NULL (0 or \0) just to illustrate that.</span></td></tr><tr><td class="number">108</td><td>&#160;</td></tr><tr><td class="number">109</td><td>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">110</td><td>&#160;</td></tr><tr><td class="number">111</td><td>    <span class="c">/*  End of our program. Oooops! We leaked the integer instance. We actually</span></td></tr><tr><td class="number">112</td><td><span class="c">     *  leaked it when we set intPointer to NULL because we overwrote the address,</span></td></tr><tr><td class="number">113</td><td><span class="c">     *  making it impossible to release it because we don't know where it was.</span></td></tr><tr><td class="number">114</td><td><span class="c">     *  Apparently the operating system will free the resources when our program</span></td></tr><tr><td class="number">115</td><td><span class="c">     *  ends so it shouldn't be a problem in this program (apparently).</span></td></tr><tr><td class="number">116</td><td><span class="c">     */</span></td></tr><tr><td class="number">117</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>

Sorry if I went over too much, but I figured there&#39;s no point explaining just the new and delete stuff if you, or somebody else stumbling across this thread, doesn&#39;t understand a bit about pointers and memory addresses.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 01:12:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
That memory is essentially unusable until the computer restarts (or possible the operating system determines that it&#39;s not in use, but I don&#39;t think this happens).
</p></div></div><p>Any decently modern operating system will free the memory once a program closes.</p><p>The main problem comes when your program runs for more than a few seconds, if you never free memory that you allocate, it&#39;ll keep building up and eventually run out of memory, cause the OS to start swaping stuff to disk, and then things get really slow.</p><p>If you new/malloc/create_bitmap/load_bitmap you <u>must</u> free the memory (delete/free/destroy_bitmap/destroy_bitmap) when you are done with it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 01 Apr 2007 01:18:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Thomas Fjellstrom said:</div><div class="quote"><p>
Any decently modern operating system will free the memory once a program closes.
</p></div></div><p>

Ah yes. So I guess when your program exits the operating system should be able to clean up any unreleased memory (makes logical sense). However, during the execution of your program you can hog a ton of memory that&#39;s not even in use anymore if you don&#39;t release it properly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 01:20:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
However, during the execution of your program you can hog a ton of memory that&#39;s not even in use anymore if don&#39;t release it properly.
</p></div></div><p>I think I just said that. Did you read the entire post?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 01 Apr 2007 01:21:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Thomas Fjellstrom said:</div><div class="quote"><p>
I think I just said that. Did you read the entire post?
</p></div></div><p>

<span class="cuss"><span><span class="cuss"><span>Shit</span></span></span></span> no. Do you think I have time to read a <span class="cuss"><span>fuck</span></span>ing novel like that! Tone it down a bit.</p><p>Obviously, you&#39;re gonna freak out on that so allow me to apologize. That last post was really my &quot;I&#39;m embarassed as I should have known that and yes, I think <b>he&#39;s</b> right&quot; post.
</p><div class="quote_container"><div class="title">Thomas Fjellstrom said:</div><div class="quote"><p>
The main problem comes when your program runs for more than a few seconds, if you never free memory that you allocate, it&#39;ll keep building up and eventually run out of memory, cause the OS to start swaping stuff to disk, and then things get really slow.
</p></div></div><p>

I thought that the operating system usually throws large idle programs out to swap in an attempt to free memory ahead of time and also so it can load things into memory that it predicts will be needed soon. I&#39;m not really an expert on operating systems though. Anybody know of a good OS writing tutorial? {smiley}
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 02:24:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
<span class="cuss"><span><span class="cuss"><span>Shit</span></span></span></span> no. Do you think I have time to read a <span class="cuss"><span>fuck</span></span>ing novel like that! Tone it down a bit.
</p></div></div><p>Uh, You seem to be upset <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Obviously, you&#39;re gonna freak out on that so allow me to apologize.
</p></div></div><p>I freaked out? It was a simple question.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I thought that the operating system usually throws large idle programs out to swap in an attempt to free memory ahead of time and also so it can load things into memory that it predicts will be needed soon.
</p></div></div><p>Sorta. It mainly swaps when asked. I something needs ram, and theres no physical ram left, the OS will swap some pages to free enough (and maybe more) for the request.</p><p>Linux will end up swaping some way underused programs if they almost are never used, and the file/disk cache is well used. (it&#39;ll swap stuff to make room for disk cache)</p><p>edit: Also, Vista has added proper file/disk caching as well, so I&#39;ll bet it will do the same. Of course it also added extra app caching features with flash drives and whatnot.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 01 Apr 2007 02:29:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Thomas Fjellstrom said:</div><div class="quote"><p>
Uh, You seem to be upset
</p></div></div><p>

No, that was said sarcastically. I would have made it more obvious, but I assume it&#39;s still EFW. When does that end exactly?</p><div class="quote_container"><div class="title">Thomas Fjellstrom said:</div><div class="quote"><p>
I freaked out? It was a simple question.
</p></div></div><p>

I didn&#39;t want you to freak out because I referred to your post as a <i>novel</i>. I&#39;m sure regular users have realized by now that I often have long replies.</p><p>And it sounded like you thought I was trying to take credit for your answer. I just wanted to clear it up... I can see now that it&#39;s gonna take a while.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 03:06:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I can see now that it&#39;s gonna take a while.
</p></div></div><p>Not at all. I just have a small beef with people not reading posts. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 01 Apr 2007 03:31:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Any decently modern operating system will free the memory once a program closes.
</p></div></div><p>Indeed; hence, (warning; evil suggestion) you can often greatly optimize shut-down times of programs using a lot of dynamically allocated memory - especially ones with a ton of destructors or other cleanup functions to be called - by simply doing a quick-and-dirty exit, focusing proper memory management on the parts of the program active during its lifetime.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Joel Pettersson)</author>
		<pubDate>Sun, 01 Apr 2007 03:44:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Joel Pattersson said:</div><div class="quote"><p>
...by simply doing a quick-and-dirty exit,...
</p></div></div><p>

My concern is which is faster and more reliable: explicitly cleaning things up or the operating system cleaning up the mess you leave behind?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 03:48:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The os can probably just defer the freeing of stuff. If the program isn&#39;t meant to do anything fancy, and doesn&#39;t run long, you don&#39;t NEED to free any of the mem yourself.</p><p>Unfortunately not all resources are memory, theres also threads, Window Handles, GDI resources, X11 Resources, and occasionally, if you don&#39;t free those sorts of things, they may not be freed correctly. Win 9x has always had a NASTY problem with not freeing ANY GDI, KERNEL32, or USER32 handles by itself when an app crashes or even just forgets to free stuff. I&#39;ve you&#39;ve ever seen the GUI turn into a copy of Win3.1, you just ran out of GDI handles.</p><p>Its a lot harder to do the same in 2k and XP though, since its based on a much better kernel.</p><p>Personally, not freeing stuff feels dirty, and wrong. I prefer to do things the <u>right</u> way when I can.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 01 Apr 2007 03:53:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Thomas Fjellstrom said:</div><div class="quote"><p>
Personally, not freeing stuff feels dirty, and wrong. I prefer to do things the <u>right</u> way when I can.
</p></div></div><p>

I&#39;m the same way. For me it&#39;s a compulsion. That&#39;s also why I edit forum posts so often. If I don&#39;t do things &quot;perfectly&quot; I&#39;m compelled to fix them.</p><p> <i>(I&#39;ve been drinking Canadian beer... I don&#39;t know if I&#39;m making spelling/grammar errors right now... :&#39;()</i>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 06:09:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If I don&#39;t do things &quot;perfectly&quot; I&#39;m compelled to fix them.
</p></div></div><p>Yeah, I usually try, but some of the time I don&#39;t even notice the errors, and anal people like to throw witty remarks around about my errors (so sue me if I have a mild case of dyslexia and really bad recall).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 01 Apr 2007 06:40:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Its a lot harder to do the same in 2k and XP though, since its based on a much better kernel.
</p></div></div><p>

I actually have hit that before (tons of leaked GDI handles in XP). XP tops out around 32,000 handles, and when they get leaked by various crappy programs over the course of 8-10 weeks (my average reboot cycle), you can end up having those issues. However, it&#39;s normally programs that stay running. Also, if you log out/back on on XP, it seems to clean out a bunch of those leaked GDI handles.</p><p>[edit]<br />X-Chat falls under the crappy programs category. It only has 129 GDI handles, however, somehow it has managed ot eat up 5,017 handles and 1,152 threads.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Sun, 01 Apr 2007 08:19:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
My concern is which is faster and more reliable: explicitly cleaning things up or the operating system cleaning up the mess you leave behind?
</p></div></div><p>The OS will catch it all, so the reliability is not affected when you perform a given part of the memory freeing manually. And doing it manually often requires many relatively costly freeing calls - and often executing much other code, particularly in heavily OO-structured programs where multiple destructurs may be called for each of many objects. Slightly slower at best, much slower at worst.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Unfortunately not all resources are memory, ...
</p></div></div><p>And there you can have reason to do things &quot;properly&quot;. When it is guaranteed that avoiding running code won&#39;t do any harm, though, it makes no more sense to put it in than adding a sleep call.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If I don&#39;t do things &quot;perfectly&quot; I&#39;m compelled to fix them.
</p></div></div><p>That goes for me as well, only what I see as being &quot;perfect&quot; is different; I go to great (sometimes semi-obsessive) lengths to avoid redundancy and overhead.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Joel Pettersson)</author>
		<pubDate>Sun, 01 Apr 2007 08:59:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Joel Pettersson said:</div><div class="quote"><p>
That goes for me as well, only what I see as being &quot;perfect&quot; is different; I go to great (sometimes semi-obsessive) lengths to avoid redundancy and overhead.
</p></div></div><p>

Yeah, I would say it is semi-obsessive of me as well. Refer to the Off-Topic thread started a few weeks ago titled <i><a href="http://allegro.cc/forums/thread/590418">Post a weird fact about you..........</a></i>.</p><p>Or for a direct link to those relevant posts:
</p><ul><li><p><a href="http://allegro.cc/forums/thread/590418/656041#target">Intro</a></p></li><li><p><a href="http://allegro.cc/forums/thread/590418/656077#target">F.E.A.R.</a></p></li><li><p><a href="http://allegro.cc/forums/thread/590418/656134#target">Unpure</a></p></li><li><p><a href="http://allegro.cc/forums/thread/590418/656210#target">Spelling and Grammar</a></p></li><li><p><a href="http://allegro.cc/forums/thread/590418/656338#target">Obsessive-Compulsion</a></p></li></ul><p>

What I see as being perfect is probably relative to the situation.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sun, 01 Apr 2007 09:19:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You are OCD, yet you still write unclean PHP code? That doesn&#39;t sound right to me.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Mon, 02 Apr 2007 03:34:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">BAF said:</div><div class="quote"><p>
You are OCD, yet you still write unclean PHP code? That doesn&#39;t sound right to me.
</p></div></div><p>

I&#39;ve never been diagnosed. As far as unclean PHP code, that depends on your definition of unclean. To me it was cleaner. Dynamically-typed langauges are considered unclean to me, so I only use them when I have to.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Mon, 02 Apr 2007 19:25:42 +0000</pubDate>
	</item>
</rss>
