<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Pre-Processing ActionScript files / classes</title>
	<atom:link href="http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/</link>
	<description>code = joy</description>
	<lastBuildDate>Thu, 11 Mar 2010 21:22:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: alimills</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-15496</link>
		<dc:creator>alimills</dc:creator>
		<pubDate>Tue, 06 Jan 2009 22:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-15496</guid>
		<description>Ugh. My code modifications were hidden on that last post.

Trying again...

For OSX, get rid of the whitespace before the #ifdef directive like so:

-----------8&lt;-----------
class HelloWorld {
    function HelloWorld() {
#ifdef DEBUG
        trace(&quot;Hello World Loaded&quot;);
#endif
    }
}
-----------&gt;8----------- 

And, drop the space between the &#039;-D&#039; flag and the DEBUG macro when calling cpp, like this:

-----------8&lt;-----------
cpp -DDEBUG -P HelloWorld.p HelloWorld.as
-----------&gt;8----------- 

Those modifications got it working for me.  Thanks again for the good post.


Ali</description>
		<content:encoded><![CDATA[<p>Ugh. My code modifications were hidden on that last post.</p>
<p>Trying again&#8230;</p>
<p>For OSX, get rid of the whitespace before the #ifdef directive like so:</p>
<p>&#8212;&#8212;&#8212;&#8211;8&lt;&#8212;&#8212;&#8212;&#8211;<br />
class HelloWorld {<br />
    function HelloWorld() {<br />
#ifdef DEBUG<br />
        trace(&#8220;Hello World Loaded&#8221;);<br />
#endif<br />
    }<br />
}<br />
&#8212;&#8212;&#8212;&#8211;&gt;8&#8212;&#8212;&#8212;&#8211; </p>
<p>And, drop the space between the &#8216;-D&#8217; flag and the DEBUG macro when calling cpp, like this:</p>
<p>&#8212;&#8212;&#8212;&#8211;8&lt;&#8212;&#8212;&#8212;&#8211;<br />
cpp -DDEBUG -P HelloWorld.p HelloWorld.as<br />
&#8212;&#8212;&#8212;&#8211;&gt;8&#8212;&#8212;&#8212;&#8211; </p>
<p>Those modifications got it working for me.  Thanks again for the good post.</p>
<p>Ali</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alimills</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-15495</link>
		<dc:creator>alimills</dc:creator>
		<pubDate>Tue, 06 Jan 2009 22:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-15495</guid>
		<description>Hey Mike,

Nice post.  To get your example running on OSX, get rid of the whitespace before the #ifdef directive like so:

-----------88----------- 

And, drop the space between the &#039;-D&#039; flag and the DEBUG macro when calling cpp, like this:

-----------88----------- 

Those modifications got it working for me.  Thanks again for the good post.


Ali</description>
		<content:encoded><![CDATA[<p>Hey Mike,</p>
<p>Nice post.  To get your example running on OSX, get rid of the whitespace before the #ifdef directive like so:</p>
<p>&#8212;&#8212;&#8212;&#8211;88&#8212;&#8212;&#8212;&#8211; </p>
<p>And, drop the space between the &#8216;-D&#8217; flag and the DEBUG macro when calling cpp, like this:</p>
<p>&#8212;&#8212;&#8212;&#8211;88&#8212;&#8212;&#8212;&#8211; </p>
<p>Those modifications got it working for me.  Thanks again for the good post.</p>
<p>Ali</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Lehmann</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5691</link>
		<dc:creator>Stephan Lehmann</dc:creator>
		<pubDate>Wed, 08 Jun 2005 09:12:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5691</guid>
		<description>I stumbled upon filepp.

http://www.cabaret.demon.co.uk/filepp/

&quot;filepp is a generic file preprocessor. It is designed to allow the functionality provided by the C preprocessor to be used with any file type. filepp supports the following keywords, all of which have their usual C preprocessor meanings and usage...

Also, as filepp is written in Perl, it is 8-bit clean and so works on any character set, not just ASCII characters.  filepp is also customisable and hopefully more user friendly than cpp.&quot;
</description>
		<content:encoded><![CDATA[<p>I stumbled upon filepp.</p>
<p><a href="http://www.cabaret.demon.co.uk/filepp/" rel="nofollow">http://www.cabaret.demon.co.uk/filepp/</a></p>
<p>&#8220;filepp is a generic file preprocessor. It is designed to allow the functionality provided by the C preprocessor to be used with any file type. filepp supports the following keywords, all of which have their usual C preprocessor meanings and usage&#8230;</p>
<p>Also, as filepp is written in Perl, it is 8-bit clean and so works on any character set, not just ASCII characters.  filepp is also customisable and hopefully more user friendly than cpp.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike chambers</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5690</link>
		<dc:creator>mike chambers</dc:creator>
		<pubDate>Thu, 31 Mar 2005 21:53:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5690</guid>
		<description>Btw, if you dont want to use CPP, you can try another pre-processor such as the Java based JAPPO:

&lt;a href=&quot;http://jappo.opensourcefinland.org/index.html&quot; rel=&quot;nofollow&quot;&gt;http://jappo.opensourcefinland.org/index.html&lt;/a&gt;

This is pretty cool because it uses a lot of the CPP directives, but also has built in macros (like timestamp, date, etc...).

mike chambers

mesh@macromedia.com</description>
		<content:encoded><![CDATA[<p>Btw, if you dont want to use CPP, you can try another pre-processor such as the Java based JAPPO:</p>
<p><a href="http://jappo.opensourcefinland.org/index.html" rel="nofollow">http://jappo.opensourcefinland.org/index.html</a></p>
<p>This is pretty cool because it uses a lot of the CPP directives, but also has built in macros (like timestamp, date, etc&#8230;).</p>
<p>mike chambers</p>
<p><a href="mailto:mesh@macromedia.com">mesh@macromedia.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Nussbaum</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5689</link>
		<dc:creator>Jason Nussbaum</dc:creator>
		<pubDate>Thu, 31 Mar 2005 17:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5689</guid>
		<description>Sweet tip, Mike.
I agree with Bokel - it&#039;d be really nice if we could get pre-processor functionality inside the IDE.</description>
		<content:encoded><![CDATA[<p>Sweet tip, Mike.<br />
I agree with Bokel &#8211; it&#8217;d be really nice if we could get pre-processor functionality inside the IDE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenny Bunch</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5688</link>
		<dc:creator>Kenny Bunch</dc:creator>
		<pubDate>Thu, 31 Mar 2005 17:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5688</guid>
		<description>I&#039;d like to comment that if you understand the notion of a preprocessor on files, it allows you to do a lot more than remove debug statements like Mike said. For instance, to an extent the Flash 7 compiler is a preprocessor. It takes your AS2 syntax and processes it down to AS1 syntax. Knowing this, you could actually have a preprocessor that could create files from more advanced files. For example, you could have abstract keywords in your files, that define an abstract method, but your preprocessor pulls that abstract key word off and creates a function with a throw statement. In this case, you are writing what appears to b syntax that allows an abstract class, but the preprocessor aids you into creating syntax for the flash compiler. This would actually allow you to write any language with equivalent constructs, etc. preprocess it and have it convert to Actionscript.</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to comment that if you understand the notion of a preprocessor on files, it allows you to do a lot more than remove debug statements like Mike said. For instance, to an extent the Flash 7 compiler is a preprocessor. It takes your AS2 syntax and processes it down to AS1 syntax. Knowing this, you could actually have a preprocessor that could create files from more advanced files. For example, you could have abstract keywords in your files, that define an abstract method, but your preprocessor pulls that abstract key word off and creates a function with a throw statement. In this case, you are writing what appears to b syntax that allows an abstract class, but the preprocessor aids you into creating syntax for the flash compiler. This would actually allow you to write any language with equivalent constructs, etc. preprocess it and have it convert to Actionscript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5687</link>
		<dc:creator>Julien</dc:creator>
		<pubDate>Thu, 31 Mar 2005 10:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5687</guid>
		<description>I use SE&#124;PY actionScript viewer ans this software can comment or uncomment all the trace in a class, very usefull and very simple.</description>
		<content:encoded><![CDATA[<p>I use SE|PY actionScript viewer ans this software can comment or uncomment all the trace in a class, very usefull and very simple.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike chambers</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5686</link>
		<dc:creator>mike chambers</dc:creator>
		<pubDate>Thu, 31 Mar 2005 10:36:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5686</guid>
		<description>&gt;Just a thought, but In Publish Settings there is a check box for Omit Trace actions, wouldn&#039;t it just be easier to toggle that when you need? (I am assuming that removes the trace() line from the code too).

Yes. If all you want to do is omit trace actions, then a preprocessor is overkill.

But, as I stated in my post, I write my own debug / trace functions which I want to remove. Omit trace actions doesnt do that.

Plus, if you read through the cpp docs you will find a ton of other useful / cool stuff that you can do.

mike chambers

mesh@macromedia.com</description>
		<content:encoded><![CDATA[<p>>Just a thought, but In Publish Settings there is a check box for Omit Trace actions, wouldn&#8217;t it just be easier to toggle that when you need? (I am assuming that removes the trace() line from the code too).</p>
<p>Yes. If all you want to do is omit trace actions, then a preprocessor is overkill.</p>
<p>But, as I stated in my post, I write my own debug / trace functions which I want to remove. Omit trace actions doesnt do that.</p>
<p>Plus, if you read through the cpp docs you will find a ton of other useful / cool stuff that you can do.</p>
<p>mike chambers</p>
<p><a href="mailto:mesh@macromedia.com">mesh@macromedia.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Medve</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5685</link>
		<dc:creator>George Medve</dc:creator>
		<pubDate>Thu, 31 Mar 2005 10:27:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5685</guid>
		<description>Just a thought, but In Publish Settings there is a check box for Omit Trace actions, wouldn&#039;t it just be easier to toggle that when you need? (I am assuming that removes the trace() line from the code too).</description>
		<content:encoded><![CDATA[<p>Just a thought, but In Publish Settings there is a check box for Omit Trace actions, wouldn&#8217;t it just be easier to toggle that when you need? (I am assuming that removes the trace() line from the code too).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Wacker</title>
		<link>http://www.mikechambers.com/blog/2005/03/30/pre-processing-actionscript-files-classes/comment-page-1/#comment-5684</link>
		<dc:creator>Simon Wacker</dc:creator>
		<pubDate>Thu, 31 Mar 2005 10:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=849#comment-5684</guid>
		<description>The As2lib Logging API (only in CVS) does something quite similar. It is not actually pre-processing the as-file and removing &quot;trace&quot; completely, but you can put the actual logging into an if-statement like:
if (logger.isDebugEnabled()) {
    logger.debug(&quot;Debug Message [&quot; + someObject + &quot;]!&quot;);
}
The pre-processing is of course a lot faster (because it removes any logging calls completely). A little more pre-processing automization would be great. Maybe in conjunction with mtasc, ant and eclipse? ;)</description>
		<content:encoded><![CDATA[<p>The As2lib Logging API (only in CVS) does something quite similar. It is not actually pre-processing the as-file and removing &#8220;trace&#8221; completely, but you can put the actual logging into an if-statement like:<br />
if (logger.isDebugEnabled()) {<br />
    logger.debug(&#8220;Debug Message [" + someObject + "]!&#8221;);<br />
}<br />
The pre-processing is of course a lot faster (because it removes any logging calls completely). A little more pre-processing automization would be great. Maybe in conjunction with mtasc, ant and eclipse? ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
