<html>
<link rel="stylesheet" href="josh.css">
<body bgcolor="#FFFFFF">

		<div id="Description">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">@cc_on, @if, @end, @set</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">n/a</span> IE <span class="emphasis">4(Win)</span> ECMA <span class="emphasis">n/a</span></td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements"></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>IE for Windows includes a scripting feature called
<span class="emphasis">conditional compilation</span>. It is a mode that, once
turned on via the <span class="literal">@cc_on</span> statement, allows JScript
statements to run under conditions that are testable within this
conditional environment. If you surround conditional compilation
statements by JavaScript comments, the conditional statements run
only in IE 4 or later for Windows, while not conflicting with other
browsers.
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			The "conditional" part comes from
numerous global properties (all preceded with the
<span class="literal">@</span> symbol) that reveal environmental properties,
such as script engine version, operating system, and CPU type. All of
this information is available from the <span class="literal">navigator</span>
object's properties on a wide range of browsers, so
this is not unique information available only to this conditional
environment.
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			To engage conditional compilation, include the following statement in
your script:
</p>
<span class="PROGRAMLISTING"><pre>/*@cc_on @*/</pre></span>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			This is a one-way toggle: once the mode is turned on, it
can't be turned off in the current page.
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			The following fragment shows how the <span class="literal">@if</span> and
related statements display some environmental information in the
window's status bar if the browser is running
JScript Version 5.6 or later (IE 6 or later):
</p>
<span class="PROGRAMLISTING"><pre>/*@cc_on @*/
/*@if (@_jscript_version&gt;= 5.6 &amp;&amp; @_x86)
    status = &quot;Now running JScript version &quot; + @_jscript_version + 
    &quot; with Intel inside.&quot;;
   @else @*/
    status = &quot;Have a nice day.&quot;;
/*@end @*/ </pre></span>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			The <span class="literal">@set</span> statement lets you assign a numeric or
Boolean value (no strings) to a variable (a variable with an
<span class="literal">@</span> prefix) within a conditional compilation
section:
</p>
<span class="PROGRAMLISTING"><pre>@set @isOK = @_win32</pre></span>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			Once initialized, that variable (including its otherwise unacceptable
identifier) can be used in script statements throughout the page.
Note that the Visual Basic-inspired syntax of <span class="literal">@</span>
statements in conditional compilation statements does not permit
semicolons at the end of statements.
</p>
							</td>
						</tr>
						<tr>
							<td colspan="2"><p>			On the one hand, conditional compilation could be useful for IE-only
deployment to screening older IE versions from new language features
that would generate compilation errors (such as
<span class="literal">try-catch</span> constructions) because such statements
compile only under very controllable version situations. In a
multibrand browser development shop, however, at most you might find
application for IE-only debugging purposes, but probably not for
actual application deployment.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="example"><span class="title">Example</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			See the discussion above.</p>
					</td>
				</tr>
			</table>
		</div>

</body>
</html>