【发布时间】:2013-11-23 12:58:25
【问题描述】:
Pascal 中是否有与 C 的 __LINE__ 宏等效的东西?也许是一个函数?
{ Prints the line number in source file. }
begin
write(__LINE__)
end.
应该打印:
3
【问题讨论】:
标签: macros pascal line-numbers
Pascal 中是否有与 C 的 __LINE__ 宏等效的东西?也许是一个函数?
{ Prints the line number in source file. }
begin
write(__LINE__)
end.
应该打印:
3
【问题讨论】:
标签: macros pascal line-numbers
如果您使用的是 Free Pascal,您可以使用:{$I %LINE%}
我不知道该构造在现有编译器之间的可移植性如何。
【讨论】: