Delphi XE 5チュートリアル12:注釈とコンパイラポインタ

3133 ワード

内容はDelphi XE 5 UPDATE 2公式ヘルプ「Delphi Reference」に由来し、本人のレベルは限られている.Delphi学习资料汉化へようこそ、兴味のある方はQQ:[email protected]
3 Comments and Compiler Directives
3注釈とコンパイラ指示語
Comments are ignored by the compiler, except when they function as separators (delimiting adjacent tokens) or compiler directives.
コメントは、隣接するtokenを区切る区切り文字またはコンパイラインジケータとして使用されない限り、コンパイラによって無視されます.
There are several ways to construct comments:
コメントを作成するには、次の方法があります.
 { Text between left and right braces is a comment. }

 
{カッコのペアに含まれる文字からなるコメント}
 
 (* Text between left-parenthesis-plus-asterisk and an



  asterisk-plus-right-parenthesis is also a comment *)

 
(*左かっこにアスタリスクと
1つのアスタリスクと右かっこの間の文字もコメント*)を構成します.
 // Text between double-slash and end of line is a comment.

 
//2つのスラッシュからこの行が終わるまで、ここの文字はコメントです
Comments that are alike cannot be nested. For instance, (*{}*) will. This latter form is useful for commenting out sections of code that also contain comments.
同じ方法のコメントはネストできません.例えば、(*{}*)でいいです.この後の形式は、注釈されたコード部分に有用な注釈が含まれていることです.
Here are some recommendations about how and when to use the three types of comment characters:
以下に、3つのタイプのコメント文字の使用方法と使用方法について説明します.
  • Use the double-slash (//) for commenting out      temporary changes made during development. You can use the Code Editor's      convenient CTRL+/(slash) mechanism to quickly insert the double-slash      comment character while you are working.

  • 二重斜線(//)を使用して、開発中に発生した一時的な変化を注釈します.作業中は、コードエディタのショートカットキーCtrl+/(スラッシュ)を使用して、二重スラッシュ注記文字をすばやく挿入できます.
  • Use the parenthesis-star "(*...*)"both      for development comments and for commenting out a block of code that      contains other comments. This comment character permits multiple lines of      source, including other types of comments, to be removed from      consideration by the compiler.

  • カッコ星「(*...*)」を使用すると、開発されたコメントとコメントの両方に削除されたコードブロックが使用され、他のコメントが含まれます.このコメント文字は、コンパイラによって削除されることを考慮して、他のタイプのコメントを含む複数行のソースコードを許可します.
  • Use the braces ({}) for in-source documentation that      you intend to remain with the code.

  • カッコ({})を使用して、ソースドキュメントに保持し続けるコードを注釈します.注記:{}はネストできません.
     
    A comment that contains a dollar sign ($) immediately after the opening { or (* is a compiler directive. For example,
    $記号が{または(*の後に続く場合、ここでのコメントはコンパイラインジケータです.たとえば、
     {$WARNINGS OFF}

    tells the compiler not to generate warning messages.
    コンパイラに警告メッセージを生成しないように伝えます.