https://wiki.beyondunreal.com/w/index.php?action=history&feed=atomPreprocessor - Revision history2017-11-18T02:22:51ZRevision history for this page on the wikiMediaWiki 1.25.1https://wiki.beyondunreal.com/Preprocessor?diff=44366&oldid=prev113.22.250.67: At the end of the first paragraph, changed "to to" to "to" only.2011-04-06T23:47:18Z<p>At the end of the first paragraph, changed "to to" to "to" only.</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 23:47, 6 April 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L2" >Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Macros are file-scope, meaning a macro defined on line X of the script class ([[.uc]]) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a [[.uci]] file <del class="diffchange diffchange-inline">to </del>to include macros in your .uc file.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Macros are file-scope, meaning a macro defined on line X of the script class ([[.uc]]) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a [[.uci]] file to include macros in your .uc file.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Command-line Switches==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Command-line Switches==</div></td></tr>
</table>113.22.250.67https://wiki.beyondunreal.com/Preprocessor?diff=43915&oldid=prevEliot: Typos etc2010-08-25T21:25:12Z<p>Typos etc</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 21:25, 25 August 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Starting with [[Unreal Engine 3]] The UnrealScript compiler now supports a preprocessor.  </div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Starting with [[Unreal Engine 3]] The UnrealScript compiler now supports a <ins class="diffchange diffchange-inline">[[wp:</ins>preprocessor<ins class="diffchange diffchange-inline">|preprocessor]]</ins>.  </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Macros are file-scope, meaning a macro defined on line X of the script class (.uc) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a .uci file to to include macros in your .uc file.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Macros are file-scope, meaning a macro defined on line X of the script class (<ins class="diffchange diffchange-inline">[[</ins>.uc<ins class="diffchange diffchange-inline">]]</ins>) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a <ins class="diffchange diffchange-inline">[[</ins>.uci<ins class="diffchange diffchange-inline">]] </ins>file to to include macros in your .uc file.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Command-line Switches==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Command-line Switches==</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L17" >Line 17:</td>
<td colspan="2" class="diff-lineno">Line 18:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`define===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`define===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>''`define <macroname>[<(paramA[,paramB...])>] [<macrodefinition>]''<br></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>''`define <macroname>[<(paramA[,paramB...])>] [<macrodefinition>]''<br></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Defines the named macro to expand to the given definition. Parameters for the macro are specified in a typeless function parameter list immediately after the name of the macro. In the macro definition, the parameters are referenced by name and prefixed with a backtick. Although I have not yet verified, my research indicated that you can also use the the special macro ''`#'' to <del class="diffchange diffchange-inline">repesent </del>the number of parameters specified, although I have not verified this though. If you don't give the macro a definition, the macro is still defined but expands to an empty string. You can also define a macro to represent a constant value.   </div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Defines the named macro to expand to the given definition. Parameters for the macro are specified in a typeless function parameter list immediately after the name of the macro. In the macro definition, the parameters are referenced by name and prefixed with a backtick. Although I have not yet verified, my research indicated that you can also use the the special macro ''`#'' to <ins class="diffchange diffchange-inline">represent </ins>the number of parameters specified, although I have not verified this though. If you don't give the macro a definition, the macro is still defined but expands to an empty string. You can also define a macro to represent a constant value.   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Equivalently, the name of the macro can be enclosed in { } after the tick as in ''`{hello}''. This makes it possible to "insert" the expansion of a macro into the middle of text that does not have conveniently placed whitespace.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Equivalently, the name of the macro can be enclosed in { } after the tick as in ''`{hello}''. This makes it possible to "insert" the expansion of a macro into the middle of text that does not have conveniently placed whitespace.  </div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L37" >Line 37:</td>
<td colspan="2" class="diff-lineno">Line 38:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Basically, this is conditional compilation. The text between ''`if'' and either ''`else'' (if present) or ''`endif'' are emitted into the processed output if the condition is true (if it is expanded to a non-empty string); if the condition is not true, only the end-of-line characters are emitted so that the line numbers in the processed text match up with those in the original text.  The text between the (optional) ''`else'' and ''`endif'' are emitted if the original condition is false.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Basically, this is conditional compilation. The text between ''`if'' and either ''`else'' (if present) or ''`endif'' are emitted into the processed output if the condition is true (if it is expanded to a non-empty string); if the condition is not true, only the end-of-line characters are emitted so that the line numbers in the processed text match up with those in the original text.  The text between the (optional) ''`else'' and ''`endif'' are emitted if the original condition is false.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>   </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>   </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This may be obvious, but any macros used in the non-emitted code (in the ''`else'' if the <del class="diffchange diffchange-inline">statment </del>is true, or before the ''`else'' if the statement is true) are not evaluated (except for nested ''`if'' blocks).</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This may be obvious, but any macros used in the non-emitted code (in the ''`else'' if the <ins class="diffchange diffchange-inline">statement </ins>is true, or before the ''`else'' if the statement is true) are not evaluated (except for nested ''`if'' blocks).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><uscript>`if(`isdefined(SOME_CONST))</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><uscript>`if(`isdefined(SOME_CONST))</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     // do some code here if SOME_CONST can be expanded to a non-empty string...</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     // do some code here if SOME_CONST can be expanded to a non-empty string...</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L49" >Line 49:</td>
<td colspan="2" class="diff-lineno">Line 50:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`include===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`include===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>''`include(<filename>)''<br></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>''`include(<filename>)''<br></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Includes the text within the file <filename> at the macro's location in the code. By default, <filename> is relative to the directory specified by the EditPackagesInPath of the [Editor.EditorEngine] section of UTGame.ini file. If you specify only the filename (no directory), it will search for the include file in the classes directory for the package being compiled.   </div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Includes the text within the file <filename> at the macro's location in the code. By default, <filename> is relative to the directory specified by the <ins class="diffchange diffchange-inline">'''</ins>EditPackagesInPath<ins class="diffchange diffchange-inline">''' </ins>of the <ins class="diffchange diffchange-inline"><code></ins>[Editor.EditorEngine]<ins class="diffchange diffchange-inline"></code> </ins>section of <ins class="diffchange diffchange-inline"><code></ins>UTGame.ini<ins class="diffchange diffchange-inline"></code> </ins>file. If you specify only the filename (no directory), it will search for the include file in the classes directory for the package being compiled.   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><uscript>`include( MyStuff.uci )</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><uscript>`include( MyStuff.uci )</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L73" >Line 73:</td>
<td colspan="2" class="diff-lineno">Line 74:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>There is a good reason to use the ''`log'' and ''`warn'' macros instead of '''LogInternal()''' and '''WarnInternal()''' functions. If you use the -final_release command line option when you "make", it will turn off all logging because ''`log'' and ''`warn'' are empty defines when using -final_release. However, the '''LogInternal()''' and '''WarnInternal()''' function(s) will still be called if you use them directly.  Using the macro to write to the log for debug info will not incur a function call overhead in a release build.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>There is a good reason to use the ''`log'' and ''`warn'' macros instead of '''LogInternal()''' and '''WarnInternal()''' functions. If you use the -final_release command line option when you "make", it will turn off all logging because ''`log'' and ''`warn'' are empty defines when using -final_release. However, the '''LogInternal()''' and '''WarnInternal()''' function(s) will still be called if you use them directly.  Using the macro to write to the log for debug info will not incur a function call overhead in a release build.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>More importantly, it also appears that calls to LogInternal (or anything *Internal) generate <del class="diffchange diffchange-inline">compile </del>errors when using -final_release.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>More importantly, it also appears that calls to <ins class="diffchange diffchange-inline">'''</ins>LogInternal<ins class="diffchange diffchange-inline">''' </ins>(or anything *Internal) generate <ins class="diffchange diffchange-inline">[[compiler </ins>errors<ins class="diffchange diffchange-inline">]] </ins>when using -final_release.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`log / `warn===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`log / `warn===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">''</del>`log(string OutputString, optional bool bRequiredCondition, optional name LogTag)<del class="diffchange diffchange-inline">''<br></del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{code|</ins>`log(<ins class="diffchange diffchange-inline">[[</ins>string<ins class="diffchange diffchange-inline">]] </ins>OutputString, <ins class="diffchange diffchange-inline">[[</ins>optional<ins class="diffchange diffchange-inline">]] [[</ins>bool<ins class="diffchange diffchange-inline">]] </ins>bRequiredCondition, <ins class="diffchange diffchange-inline">[[</ins>optional<ins class="diffchange diffchange-inline">]] [[</ins>name<ins class="diffchange diffchange-inline">]] </ins>LogTag)<ins class="diffchange diffchange-inline">}}</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">''</del>`warn(string OutputString, optional bool bRequiredCondition)<del class="diffchange diffchange-inline">''<br></del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{code|</ins>`warn(<ins class="diffchange diffchange-inline">[[</ins>string<ins class="diffchange diffchange-inline">]] </ins>OutputString, <ins class="diffchange diffchange-inline">[[</ins>optional<ins class="diffchange diffchange-inline">]] [[</ins>bool<ins class="diffchange diffchange-inline">]] </ins>bRequiredCondition)<ins class="diffchange diffchange-inline">}}</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Wrapper macros for the LogInternal and WarnInternal functions declared in Object.uc. If bRequiredCondition is specified, the message will only be logged if the condition is true.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Wrapper macros for the <ins class="diffchange diffchange-inline">'''</ins>LogInternal<ins class="diffchange diffchange-inline">''' </ins>and <ins class="diffchange diffchange-inline">'''</ins>WarnInternal<ins class="diffchange diffchange-inline">''' </ins>functions declared in Object.uc. If <ins class="diffchange diffchange-inline">'''</ins>bRequiredCondition<ins class="diffchange diffchange-inline">''' </ins>is specified, the message will only be logged if the condition is true.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Both macros are disabled if scripts are compiled with the -final_release command line option.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Both macros are disabled if scripts are compiled with the -final_release command line option.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`logd===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`logd===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">''</del>`logd(string OutputString, optional bool bRequiredCondition, optional name LogTag)<del class="diffchange diffchange-inline">''<br></del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{code|</ins>`logd(<ins class="diffchange diffchange-inline">[[</ins>string<ins class="diffchange diffchange-inline">]] </ins>OutputString, <ins class="diffchange diffchange-inline">[[</ins>optional<ins class="diffchange diffchange-inline">]] [[</ins>bool<ins class="diffchange diffchange-inline">]] </ins>bRequiredCondition, <ins class="diffchange diffchange-inline">[[</ins>optional<ins class="diffchange diffchange-inline">]] [[</ins>name<ins class="diffchange diffchange-inline">]] </ins>LogTag)<ins class="diffchange diffchange-inline">}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Identical to the `log macro, except that it is only enabled if scripts are compiled in debug mode.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Identical to the `log macro, except that it is only enabled if scripts are compiled in debug mode.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This macro is disabled if scripts are compiled with the -final_release switch.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This macro is disabled if scripts are compiled with the -final_release switch.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`assert===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===`assert===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">''</del>`assert(bool bCondition)<del class="diffchange diffchange-inline">''<br></del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{code|</ins>`assert(<ins class="diffchange diffchange-inline">[[</ins>bool<ins class="diffchange diffchange-inline">]] </ins>bCondition)<ins class="diffchange diffchange-inline">}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Wrapper macro for the Assert intrinsic expression.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Wrapper macro for the Assert intrinsic expression.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Eliothttps://wiki.beyondunreal.com/Preprocessor?diff=42996&oldid=prevEliot: /* The Preprocessor */2010-04-21T23:46:26Z<p><span dir="auto"><span class="autocomment">The Preprocessor</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 23:46, 21 April 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">==</del>The <del class="diffchange diffchange-inline">Preprocessor==</del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Starting with [[Unreal Engine 3]] </ins>The UnrealScript compiler now supports a preprocessor.  </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">The UT3 </del>UnrealScript compiler now supports a preprocessor. The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Macros are file-scope, meaning a macro defined on line X of the script class (.uc) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a .uci file to to include macros in your .uc file.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Macros are file-scope, meaning a macro defined on line X of the script class (.uc) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a .uci file to to include macros in your .uc file.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Command-line Switches==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Command-line Switches==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===-debug===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===-debug===</div></td></tr>
</table>Eliothttps://wiki.beyondunreal.com/Preprocessor?diff=42994&oldid=prevEliot: Added the us navbox2010-04-21T17:03:14Z<p>Added the us navbox</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 17:03, 21 April 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L89" >Line 89:</td>
<td colspan="2" class="diff-lineno">Line 89:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This macro is disabled if scripts are compiled with the -final_release switch.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This macro is disabled if scripts are compiled with the -final_release switch.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{navbox unrealscript}}</ins></div></td></tr>
</table>Eliothttps://wiki.beyondunreal.com/Preprocessor?diff=32890&oldid=prevHoMeRSiMpSoN: New page: ==The Preprocessor== The UT3 UnrealScript compiler now supports a preprocessor. The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation ...2008-08-15T15:19:16Z<p>New page: ==The Preprocessor== The UT3 UnrealScript compiler now supports a preprocessor. The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation ...</p>
<p><b>New page</b></p><div>==The Preprocessor==<br />
The UT3 UnrealScript compiler now supports a preprocessor. The preprocessor works much like the C++ preprocessor and is perfect for supporting conditional compilation via macros.<br />
Macros are file-scope, meaning a macro defined on line X of the script class (.uc) file is only usable on lines X+n in that file and not in any other files (unless it is included in another .uc file). However, you can create a .uci file to to include macros in your .uc file.<br />
==Command-line Switches==<br />
===-debug===<br />
Using a -debug command line option causes a ''`debug'' macro to be defined.<br />
===-final_release===<br />
Using a -final-release command line option causes UPP to define the macro ''`final_release'', as well as disable all wrapper macros (''`log'', ''`logd'', ''`warn'', ''`assert''). (see below).<br />
===-nopreprocess===<br />
Using a -nopreprocess command line option turns off all macro and comment preprocessing.<br />
===-intermediate===<br />
Using a -intermediate command line option will save the processed versions of the files compiled (for tracking down errors in macros) to <My Documents>\PreprocessedFiles\<package>\<class>.uc<br />
<br />
==Using Macros==<br />
<br />
===`define===<br />
''`define <macroname>[<(paramA[,paramB...])>] [<macrodefinition>]''<br><br />
Defines the named macro to expand to the given definition. Parameters for the macro are specified in a typeless function parameter list immediately after the name of the macro. In the macro definition, the parameters are referenced by name and prefixed with a backtick. Although I have not yet verified, my research indicated that you can also use the the special macro ''`#'' to repesent the number of parameters specified, although I have not verified this though. If you don't give the macro a definition, the macro is still defined but expands to an empty string. You can also define a macro to represent a constant value. <br />
<br />
Equivalently, the name of the macro can be enclosed in { } after the tick as in ''`{hello}''. This makes it possible to "insert" the expansion of a macro into the middle of text that does not have conveniently placed whitespace. <br />
<uscript>hippo`{hello}potamus<br />
</uscript><br />
Other examples:<br />
<uscript>`define SOME_CONST 1<br />
<br />
`define hello "Hello, World!"<br />
<br />
`define SomeMacro(param1, param2) CallMyFunction(`param1, `param2)</uscript><br />
<br />
===`if / `else / `endif===<br />
''`if(<string>)''<br />
<br />
''`else''<br />
<br />
''`endif''<br><br />
Basically, this is conditional compilation. The text between ''`if'' and either ''`else'' (if present) or ''`endif'' are emitted into the processed output if the condition is true (if it is expanded to a non-empty string); if the condition is not true, only the end-of-line characters are emitted so that the line numbers in the processed text match up with those in the original text. The text between the (optional) ''`else'' and ''`endif'' are emitted if the original condition is false. <br />
<br />
This may be obvious, but any macros used in the non-emitted code (in the ''`else'' if the statment is true, or before the ''`else'' if the statement is true) are not evaluated (except for nested ''`if'' blocks).<br />
<uscript>`if(`isdefined(SOME_CONST))<br />
// do some code here if SOME_CONST can be expanded to a non-empty string...<br />
`endif<br />
<br />
`if(`isdefined(SOME_OTHER_CONST))<br />
// do some code here if SOME_CONST can be expanded to a non-empty string...<br />
`else<br />
//do some code here if SOME_CONST can NOT be expanded to a non-empty string...<br />
`endif</uscript><br />
===`include===<br />
''`include(<filename>)''<br><br />
Includes the text within the file <filename> at the macro's location in the code. By default, <filename> is relative to the directory specified by the EditPackagesInPath of the [Editor.EditorEngine] section of UTGame.ini file. If you specify only the filename (no directory), it will search for the include file in the classes directory for the package being compiled. <br />
<uscript>`include( MyStuff.uci )<br />
<br />
`include( MyPackage/Classes/MyGlobals.uci )<br />
</uscript><br />
===`isdefined / `notdefined===<br />
''`isdefined(<macroname>)''<br><br />
''`notdefined(<macroname>)''<br><br />
Evaluates to the string "1" if the macro is (''`isdefined'') or is not (''`notdefined'') defined, regardless of the macros definition. This useful for conditional compilation. You can include code only in debug or release builds, or based on other defined constants.<br />
<uscript>`if(`isdefined(SOME_CONST))<br />
// do some code here if SOME_CONST is defined...<br />
`endif<br />
<br />
`if(`notdefined(SOME_CONST))<br />
// do some code here if SOME_CONST is NOT defined...<br />
`endif<br />
</uscript><br />
===`undefine===<br />
''undefine(<macroname>)''<br><br />
Remove the current definition of <macroname>. <br />
<uscript>`undefine(SOME_CONST)</uscript><br />
==Predefined Macros for Logging==<br />
There is a good reason to use the ''`log'' and ''`warn'' macros instead of '''LogInternal()''' and '''WarnInternal()''' functions. If you use the -final_release command line option when you "make", it will turn off all logging because ''`log'' and ''`warn'' are empty defines when using -final_release. However, the '''LogInternal()''' and '''WarnInternal()''' function(s) will still be called if you use them directly. Using the macro to write to the log for debug info will not incur a function call overhead in a release build. <br />
<br />
More importantly, it also appears that calls to LogInternal (or anything *Internal) generate compile errors when using -final_release.<br />
===`log / `warn===<br />
''`log(string OutputString, optional bool bRequiredCondition, optional name LogTag)''<br><br />
''`warn(string OutputString, optional bool bRequiredCondition)''<br><br />
Wrapper macros for the LogInternal and WarnInternal functions declared in Object.uc. If bRequiredCondition is specified, the message will only be logged if the condition is true.<br />
<br />
Both macros are disabled if scripts are compiled with the -final_release command line option. <br />
===`logd===<br />
''`logd(string OutputString, optional bool bRequiredCondition, optional name LogTag)''<br><br />
Identical to the `log macro, except that it is only enabled if scripts are compiled in debug mode. <br />
<br />
This macro is disabled if scripts are compiled with the -final_release switch. <br />
===`assert===<br />
''`assert(bool bCondition)''<br><br />
Wrapper macro for the Assert intrinsic expression. <br />
<br />
This macro is disabled if scripts are compiled with the -final_release switch.</div>HoMeRSiMpSoN