7.3.4. Adding comments to your batch files

You can add comments to your script files:

Rules for using comments in scripts

The following rules apply to comments in scripts:

  • Outside a macro definition all comments must begin and end on the same line, for example:


    ; comment
    // comment
    /* comment */
    //# comment

    You cannot have:


    /*
       This is a comment
    */

  • Inside a macro definition:

    • comments cannot start with ;

    • only // or //# comments can be placed at the end of a macro statement, for example:


      macro_statement; // comment

    • you can use /* */ for comments, but the comment text must be a single line, for example, you can have:


      /* This is a comment */
      /*
          This is another comment
      */

      but you cannot have:


      /* 
          This is a
          multiline comment
      */

Comment handling with log and journal files

If you have turned on logging or journaling, then any comments in your script files are handled as follows:

  • // and ; comments are not written to any log or journal file

  • //# comments are written to journal files only, and //# is replaced by ; in the journal file, for example, //# comment appears in the journal as:


    ; comment

  • /* */ comments are written to both log and journal files, and appear as:

    • /* comment */ in log files

    • > /* comment */ in journal files.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0181G
Non-Confidential