export_defexport_defExportDefExportDefexport_def导出定义(算子)
名称
export_defexport_defExportDefExportDefexport_def — 在函数的导出代码中插入任意文本。
签名
描述
export_defexport_defExportDefExportDefExportDefexport_def 允许定义代码行或文本块,这些内容将原样写入被导出函数或程序的输出文件中。
参数 PositionPositionPositionPositionpositionposition 控制 DeclarationDeclarationDeclarationDeclarationdeclarationdeclaration 中给定文本的位置。支持以下选项:
- 'in_place'"in_place""in_place""in_place""in_place""in_place" - #
-
文本被插入到程序的实际位置,即相邻程序行之间。
- 'at_file_begin'"at_file_begin""at_file_begin""at_file_begin""at_file_begin""at_file_begin" - #^^
-
文本位于导出文件的最开头。
- 'before_procedure'"before_procedure""before_procedure""before_procedure""before_procedure""before_procedure" - #^
-
文本在定义它的函数之前立即被导出。
- 'after_procedure'"after_procedure""after_procedure""after_procedure""after_procedure""after_procedure" - #$
-
文本在定义它的函数之后立即被导出。
- 'at_file_end'"at_file_end""at_file_end""at_file_end""at_file_end""at_file_end" - #$$
-
文本位于导出文件的最末尾。
在程序列表中,export_defexport_defExportDefExportDefExportDefexport_def 并未采用常规算子语法表示,而是通过特殊字符序列标记。该行首字符为导出标记符 #,其后可跟随上述列出的位置标记符。若在全文编辑器中输入导出定义,请注意 # 前面绝对不能有空格。
为提高可读性,导出字符序列后可跟随一个空格字符,该空格不被视为导出文本的一部分。所有额外空格均会添加到导出内容中。
在当前函数内导出的行,其缩进与当前程序行保持一致。但存在一个例外:若导出文本紧接在导出标记或可选空格后以 # 开头,则该导出文本将完全不缩进,例如:
for Index := 1 to 5 by 1
# #ifdef MY_SWITCH
# int cnt = 100;
* an optional code block
# #endif
endfor
被导出到:
proc (...)
{
...
for (...)
{
#ifdef MY_SWITCH
int cnt = 100;
// an optional block
#endif
}
...
}
导出定义可像普通算子一样启用或禁用。禁用的导出定义不会被导出。
参数
PositionPositionPositionPositionpositionposition (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
输出文本的写入位置。
值列表:
'after_procedure'"after_procedure""after_procedure""after_procedure""after_procedure""after_procedure", 'at_file_begin'"at_file_begin""at_file_begin""at_file_begin""at_file_begin""at_file_begin", 'at_file_end'"at_file_end""at_file_end""at_file_end""at_file_end""at_file_end", 'before_procedure'"before_procedure""before_procedure""before_procedure""before_procedure""before_procedure", 'in_place'"in_place""in_place""in_place""in_place""in_place"
DeclarationDeclarationDeclarationDeclarationdeclarationdeclaration (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
已导出的文本。
结果
export_defexport_defExportDefExportDefExportDefexport_def 永远不会被执行。
另见
commentcommentCommentCommentCommentcomment
模块
基础