Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
JScript
JScript Reference
Language Reference
Statements
 @cc_on Statement
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
JScript 8.0
@cc_on Statement

Updated: March 2009

Activates conditional compilation support within comments in a script.

@cc_on 

The @cc_on statement can turn on conditional compilation within comments in a script.

It is not common to use conditional compilation variables in scripts written for ASP or ASP.NET pages or command-line programs because the capabilities of the compilers can be determined by using other methods.

When you write a script for a Web page, always put conditional compilation code in comments. This enables hosts that do not support conditional compilation to ignore it.

An @if or @set statement outside of a comment also activates conditional compilation.

The following example illustrates the use of the @cc_on statement.

/*@cc_on @*/
/*@
    document.write("JScript version: " + @_jscript_version + ".");
    document.write("<br />");
    @if (@_win32)
        document.write("Running on the 32-bit version of Windows.");
    @elif (@_win16)
        document.write("Running on the 16-bit version of Windows.");
    @else
        document.write("Running on a different operating system.");
    @end
@*/

Date

History

Reason

March 2009

Modified introduction and remarks and added example.

Content bug fix.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker