内容源自Delphi XE5 UPDATE 2官方帮助《Delphi Reference》,本人水平有限,欢迎各位高人修正相关错误!
也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者可QQ:34484690@qq.com

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 *)

(*  由左圆括号加一个星号和

一个星号加右圆括号之间的文字也构成注释 *)

 // Text between double-slash and end of line is a comment.

//  由两个斜杠开始直到这一行的结束,这里的文字是注释

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:

以下是有关如何以及何时使用三种类型的注释字符的一些建议:

  • 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.

它告诉编译器不要产生警告信息。

Delphi XE5教程12:注释和编译器指示字的更多相关文章

  1. Delphi XE5教程11:Tokens

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误!也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者可 ...

  2. Delphi XE5教程3:实例程序

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

  3. Delphi XE5教程10:Delphi字符集

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误!也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者可 ...

  4. Delphi XE5教程9:基本语法元素

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误!也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者可 ...

  5. Delphi XE5教程8:使用Delphi命名空间

    // Project file declarations... //项目文件声明… program MyCompany.ProjectX.ProgramY; // Unit source file d ...

  6. Delphi XE5教程7:单元引用和uses 子句

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

  7. Delphi XE5教程6:单元的结构和语法

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

  8. Delphi XE5教程5:程序的结构和语法

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

  9. Delphi XE5教程2:程序组织

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

随机推荐

  1. IOS开发 xcode报错之has been modified since the precompiled header was built

    转载的文章  很实用 IOS开发xcode报错之has been modified since the precompiled header was built 今天做百度地图的时候第一次发现下面错误 ...

  2. GET和POST的主要区别

    1.get是从服务器上获取数据,post是向服务器传送数据 2.在客户端上,get通过url提交数据,数据在url上可以看到,post方式,数据放置在HTMLHEADER内提交 3.对于get方式,服 ...

  3. iOS 10 的一些资料整理

    文/判若两人丶(简书作者)原文链接:http://www.jianshu.com/p/0cc7aad638d9 1.iOS 10 隐私权限设置 iOS 10 开始对隐私权限更加严格,如果你不设置就会直 ...

  4. c语言中赋值语句的结果

    c语言中赋值语句的结果 最近在看<C语言接口与实现>,在第一章就发现一个以前很少用到的用法.在实现strcpy函数时,书中给出了两种实现. //version 1, 使用数组实现(新手惯用 ...

  5. PHP实现无级递归分类(ThinkPHP框架)

    /** * 无级递归分类 * @param int $assortPid 要查询分类的父级id * @param mixed $tag 上下级分类之间的分隔符 * @return string $tr ...

  6. Win10环境下使用VS2015编译PJProject

    一.pjproject源码下载 下载地址:http://www.pjsip.org/ 二.编译之前 1.pj配置,通常直接复制并重命名config_site_simple.h为config_site. ...

  7. 日期类型的input元素设置默认值为当天

    html文件:<input name="" type="date" value="" id="datePicker" ...

  8. DWZ框架学习

    转自(http://blog.sina.com.cn/s/blog_667ac0360102ec0q.html) 初始化配置文件 $(function(){ DWZ.init("dwz.fr ...

  9. 配置多个Log4net实例

    应用场景: 控制软件工程拆分为多个子项目,在开发阶段希望每个子项目的日志是单独的.同时又希望日志统一集中定义在Tools(Tools为工具类项目,生成Tools.dll)下,而不是分散在各个子项目中. ...

  10. orcale 列改为大字段

    --添加临时列ALTER TABLE MPD_TASK_LIST ADD(  CLOB_TEMP clob);--数据拷贝到临时列update MPD_TASK_LIST set CLOB_TEMP ...