<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Outer Heaven - Programming</title>
    <link>http://outerheaven.c-reality.com/</link>
    <description>66 75 72 69 6f 75 73 20 61 6e 67 65 6c 73</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2 - http://www.s9y.org/</generator>
    
    <image>
        <url>http://outerheaven.c-reality.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Outer Heaven - Programming - 66 75 72 69 6f 75 73 20 61 6e 67 65 6c 73</title>
        <link>http://outerheaven.c-reality.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>PowerBASIC: Game of Guess</title>
    <link>http://outerheaven.c-reality.com/archives/78-PowerBASIC-Game-of-Guess.html</link>
            <category>Programming</category>
    
    <comments>http://outerheaven.c-reality.com/archives/78-PowerBASIC-Game-of-Guess.html#comments</comments>
    <wfw:comment>http://outerheaven.c-reality.com/wfwcomment.php?cid=78</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://outerheaven.c-reality.com/rss.php?version=2.0&amp;type=comments&amp;cid=78</wfw:commentRss>
    

    <author>nospam@example.com (Chris)</author>
    <content:encoded>
    This week I decided to get back into the swing of things with regards to programming with &lt;a href=&quot;http://www.powerbasic.com&quot;&gt;PowerBASIC&lt;/a&gt;. Previously I&#039;d been &lt;a href=&quot;http://outerheaven.c-reality.com/archives/39-PowerBASIC-Variable-Basics-Part-1.html&quot;&gt;giving myself a course&lt;/a&gt; on Win32 programming with PowerBASIC for Windows without gaining much headway. Not only was I having to learn a programming language, but I was forced to learn the Win32 API at the same time in order to make use of the language in the first place! Not good for a budding programmer, so after some trial and error I settled with the &lt;a href=&quot;http://www.powerbasic.com/products/pbcc/&quot;&gt;PowerBASIC Console Compiler&lt;/a&gt;. I was able to come up with a simple game quickly since the syntax is very similar &lt;a href=&quot;http://en.wikipedia.org/wiki/QBASIC&quot;&gt;QBASIC&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&#039; This is a simple guessing game. All you need to do is guess a number between 1 and 10.&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&#039; Written by Chris on 3-5-2007 @ 1:07PM CDT version 1.3&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;#COMPILE EXE&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;#DIM ALL&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;FUNCTION PBMAIN () AS LONG&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; DIM rand AS INTEGER&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; DIM guess AS INTEGER&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; RANDOMIZE TIMER&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; rand% = RND(1,10)&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; LoopBack:&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; PRINT &amp;quot;I&#039;m thinking of a number between 1-10&amp;quot;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;    &amp;#160;&amp;#160;&amp;#160; INPUT guess%&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; IF guess% &amp;gt; rand% THEN&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; PRINT &amp;quot;Too high!&amp;quot;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; GOTO LoopBack&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; ELSEIF guess% &amp;lt; rand% THEN&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; PRINT &amp;quot;Too low!&amp;quot;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; GOTO Loopback&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; ELSE&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; guess% = rand%&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; COLOR 15&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; PRINT &amp;quot;You win!&amp;quot;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; COLOR 7                                 &amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; &amp;#160;&amp;#160;&amp;#160; &#039; Reset the console color otherwise it&#039;s going to look crappy&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; END IF&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;br /&gt;END FUNCTION&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;/span&gt; &lt;br /&gt;&lt;a href=&quot;http://outerheaven.c-reality.com/archives/78-PowerBASIC-Game-of-Guess.html#extended&quot;&gt;Continue reading &quot;PowerBASIC: Game of Guess&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 08 Mar 2007 14:51:55 -0600</pubDate>
    <guid isPermaLink="false">http://outerheaven.c-reality.com/archives/78-guid.html</guid>
    
</item>
<item>
    <title>PowerBASIC: Variable Basics Part 1</title>
    <link>http://outerheaven.c-reality.com/archives/39-PowerBASIC-Variable-Basics-Part-1.html</link>
            <category>Programming</category>
    
    <comments>http://outerheaven.c-reality.com/archives/39-PowerBASIC-Variable-Basics-Part-1.html#comments</comments>
    <wfw:comment>http://outerheaven.c-reality.com/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://outerheaven.c-reality.com/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Chris)</author>
    <content:encoded>
    Okay, as promised I will be posting code and thoughts as I teach myself PowerBASIC. After &lt;a href=&quot;http://outerheaven.c-reality.com/archives/36-PowerBASIC-First-Win32-program.html&quot;&gt;my last bit&lt;/a&gt; with the ever popular &amp;quot;Hello, World!&amp;quot; I decided to head to variables.&lt;br /&gt;&lt;br /&gt;First off, variables are much like those in &lt;a href=&quot;http://en.wikipedia.org/wiki/C_programming&quot;&gt;C&lt;/a&gt;. You declare them, then give them values. For example in C:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;// quick program to show how variables work&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;int main(void);&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; // Let&#039;s declare an integer variable&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; int number;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; // Now let&#039;s assign it a value of 2&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; number = 2;&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; // Now let&#039;s print the value of the variable to the console to see the value we assigned it&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; printf(&amp;quot;The value of number is %d&amp;quot;, number);&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When compiled the above will display &amp;quot;2&amp;quot; on your console (whether it be Windows, DOS, Linux, etc.). In PowerBASIC things are just a tad different:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;#COMPILE EXE&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;#DIM ALL&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;FUNCTION PBMAIN() AS LONG&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &#039; okay these are our integer variables&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; DIM a AS INTEGER&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; DIM b AS INTEGER&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &#039; this will be our string variable so it work&#039;s with MSGBOX (see above)&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; DIM answer AS STRING&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &#039; now we tack values into those integer and string variables&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; a% = 1&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; b% = 2&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; answer$ = STR$(a% + b%)&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &#039; we used the STR$ function to convert the integers to a string so MSGBOX will work&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; MSGBOX &amp;quot;1 + 2 = &amp;quot; &amp;amp; answer$&lt;/span&gt;&lt;br style=&quot;color: rgb(255, 153, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;END FUNCTION&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;To declare a variable in PB you need to start with a DIM statement then follow with what type of variable you want it to be. DIM a AS INTEGER declares the variable &amp;quot;a&amp;quot; as an integer. Assigning values to variables is much like C as you can see from the code above.&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;text-decoration: underline; color: rgb(192, 192, 192);&quot;&gt;Variable type specifiers in PB&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;%&lt;/span&gt; - integer&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;amp;&lt;/span&gt; - long integer&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; - quad integer&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;?&lt;/span&gt; - byte&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;??&lt;/span&gt; - word&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;???&lt;/span&gt; - double word&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;!&lt;/span&gt; - single-precision&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#&lt;/span&gt; - double-precision&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;##&lt;/span&gt; - extended-precision&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;$&lt;/span&gt; - string&lt;/span&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;br style=&quot;color: rgb(192, 192, 192);&quot; /&gt;&lt;span style=&quot;color: rgb(192, 192, 192);&quot;&gt;As I get more comfortable with PB I&#039;ll discuss variable scope (local/global) in another post.&lt;/span&gt;&lt;/span&gt; 
    </content:encoded>

    <pubDate>Wed, 22 Feb 2006 15:07:20 -0600</pubDate>
    <guid isPermaLink="false">http://outerheaven.c-reality.com/archives/39-guid.html</guid>
    
</item>
<item>
    <title>PowerBASIC: First Win32 program</title>
    <link>http://outerheaven.c-reality.com/archives/36-PowerBASIC-First-Win32-program.html</link>
            <category>Programming</category>
    
    <comments>http://outerheaven.c-reality.com/archives/36-PowerBASIC-First-Win32-program.html#comments</comments>
    <wfw:comment>http://outerheaven.c-reality.com/wfwcomment.php?cid=36</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://outerheaven.c-reality.com/rss.php?version=2.0&amp;type=comments&amp;cid=36</wfw:commentRss>
    

    <author>nospam@example.com (Chris)</author>
    <content:encoded>
    I made my first Win32 program using &lt;a href=&quot;http://www.powerbasic.com&quot;&gt;PowerBASIC&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Code&quot;&gt;#COMPILE EXE&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Code&quot;&gt;#DIM ALL&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 0);&quot; /&gt;&lt;br style=&quot;color: rgb(0, 0, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Code&quot;&gt;FUNCTION PBMAIN() AS LONG&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;Code&quot;&gt;MSGBOX &amp;quot;Hello, World!&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 0);&quot; /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Code&quot;&gt;END FUNCTION&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After you stop laughing I&#039;ll mention this is my first attempt at Win32. I&#039;m much more at home with a terminal/console. It seems so much simpler to just &lt;a href=&quot;http://en.wikipedia.org/wiki/Printf&quot;&gt;printf()&lt;/a&gt; your feedback to the user rather than creating dialogs.&lt;br /&gt;&lt;br /&gt;Anyway, I figure it&#039;s high time I did some Win32 programming, and PowerBASIC seemed like a great place to start. I was able to purchase a license using some of my budget up this year with the hopes that I could create a few small programs that would help me out around the building. I was initially going to work with Visual Basic but I have bloatphobia. I can&#039;t stand seeing EXE files that are 5MB compiled with VB, then the same program ported to PowerBASIC is less than 1MB and faster to boot.&lt;br /&gt;&lt;br /&gt;Anyway, I will be posting laughable bits of PB code here as I slug my way through the Win32 API. 
    </content:encoded>

    <pubDate>Mon, 20 Feb 2006 17:01:19 -0600</pubDate>
    <guid isPermaLink="false">http://outerheaven.c-reality.com/archives/36-guid.html</guid>
    
</item>
<item>
    <title>Optimizing .EXE size for lcc-win32</title>
    <link>http://outerheaven.c-reality.com/archives/15-Optimizing-.EXE-size-for-lcc-win32.html</link>
            <category>Programming</category>
    
    <comments>http://outerheaven.c-reality.com/archives/15-Optimizing-.EXE-size-for-lcc-win32.html#comments</comments>
    <wfw:comment>http://outerheaven.c-reality.com/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://outerheaven.c-reality.com/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>nospam@example.com (Chris)</author>
    <content:encoded>
    I&#039;ve been using &lt;a href=&quot;http://www.q-software-solutions.de&quot;&gt;Q Software Solution&lt;/a&gt;&#039;s free (for personal use) &lt;a href=&quot;http://www.q-software-solutions.de/products/lcc-win32/index.shtml&quot;&gt;lcc-win32&lt;/a&gt; C compiler lately due to the updated &lt;a href=&quot;http://en.wikipedia.org/wiki/C99&quot;&gt;C99&lt;/a&gt; standard and the fact that it works with the Win32 API. After great initial impressions I was disapointed to see that compiled .EXE files had tremendous sizes compared to my older MS-DOS based compilers. For example this code snippet yielded an .EXE size of 49.5KB:&lt;br /&gt;&lt;br /&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot;&gt;// This is a simple Hello World program&lt;/span&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot;&gt;int main(void)&lt;/span&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot;&gt;&amp;#160;&amp;#160;&amp;#160; printf(&amp;quot;Hello World!&amp;quot;);&lt;/span&gt;&lt;br style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot; /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 255, 0);&quot;&gt;}&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;For having just six lines of code and one function call that&#039;s an awefully large executable. I looked into the issue on Q Software&#039;s forum and found that they changed their libraries in order to maintain C99 compatibility. The fix is to add &lt;span class=&quot;postbody&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;msvcrt.lib&lt;/span&gt; to the link process. This was easy to do by clicking &lt;span style=&quot;font-weight: bold;&quot;&gt;Project&lt;/span&gt; &amp;gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;Configuration&lt;/span&gt; &amp;gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;Linker&lt;/span&gt; and adding &amp;quot;msvcrt.lib&amp;quot; under the &amp;quot;Additional files to be included in the link.&amp;quot; I recompiled the above code after doing this and the file size dropped to 12.9KB. Much better!&lt;br /&gt;&lt;br /&gt;For further optimization you can choose two options to lower the executable size even more. &lt;span style=&quot;font-weight: bold;&quot;&gt;Project&lt;/span&gt; &amp;gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;Configuration&lt;/span&gt; &amp;gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;Compiler&lt;/span&gt; and tick &amp;quot;Optimize&amp;quot; under Code generation. Then go to the Linker tab and tick &amp;quot;Do not include the debug information&amp;quot; under Options. With these settings the above Hello World program had a compiled size of just 3.1KB!&lt;br /&gt;&lt;/span&gt; 
    </content:encoded>

    <pubDate>Fri, 03 Feb 2006 10:20:30 -0600</pubDate>
    <guid isPermaLink="false">http://outerheaven.c-reality.com/archives/15-guid.html</guid>
    
</item>

</channel>
</rss>