English 中文(简体)
我如何利用某些RTL/VCL或Delphi语言内容发出警告
原标题:How can I generate a Warning when using certain RTL/VCL or Delphi language elements

我要指出某些内容、职能和类别,如所解释,以便汇编者发出警告。

我的意图是使来文方的某些方面现代化。 特别是在注重平台独立性时。

E.g. By marking the WinAPI and special Windows classes (such as TRegistry) as "deprecated" they could be replaced or at least moved and made platform independent. As for the language elements, I would especially like to deprecate the with, label and goto keywords.

我已尝试通过插入<条码>(IF DECLARED(......)} 缩略语

有些人是否知道这样做的工具?

最佳回答

作为警告的一种替代办法,你可以简单地看一看所有源代码,并报告这些建筑的使用。

在很少调查的情况下,我相信你能够找到一些固定的法典分析工具,甚至可以进一步,并提醒你注意某些密码。 (E.g. 审判的不当使用,最后是附带的例外。)

作为你建设过程的一个步骤,将电灯或静态代码分析器投放,而且你同样可以汇编时间警告。

问题回答

您无法对关键词( with,goto<>/code>等做任何解释。 如果你想使你的法典现代化,简单地看着这些字眼,如果你发现的话,就改变你的法典。

Win.*核心单位的识别资料也是如此。 您可以修改RTL并对之进行反驳,或者您可以从/code>,或仅指这些单位。 我建议不要再合并劳教。 比如说,你与德国统计局的单位打交道的是你们。

除了Win.* 单位外,大多数RTL实际上是独立的平台,甚至<代码>> 和<代码> >goto<>/code> 也将在64个轨道或Mac上运行。

我的建议:找到使你的法典现代化的更好办法。 Don t试图解释RTL提供的东西。

You cannot put a warning on core language features like with, label and goto no matter how much you hate them.
The fact that these are reserved words should have tipped you off on this.

这些特点并不是在任何单位,而是帕斯卡尔语的一个特征(而且从一开始就如此),并深入到汇编者。

你甚至可以重新定义,因为它们是保留词。

www.un.org/Depts/DGACM/index_spanish.htm 首先,我确实告诉你,由于其他人所说的一切原因,你想走的道路。 如果你觉得你必须,那么,这里是一种能满足你要求的方法。

您可在项目上查阅<代码>platform具体代码的警告。 至于你认为被贬低但实际上没有被德尔菲贬低的其他事情,我有一个解决办法,将开展一些工作。

设立一个单位,重新申报你想要的课堂,例如:

unit PleaseDeprecateThisStuff;

uses
  Registry;

interface

type
  TRegistry = class (Registry.TRegistry)
  end deprecated;

implementation

end;

EDIT2:我认为我应该进一步解释来文方。 如TRegistry,你需要把同一名称版本列入这个单位,使之与另一个单位的版本相同。 保证在单位(制)的使用条款中加入这一单位,并在类型章节中预先确定该单位的名称,例如<编码>。 书记官处。 TRegistry/code>。

包括你想要解释的所有内容,然后将这个单位列入end,uses article of EVERY unit 你想“protect”。

EDIT:这一骗局只能帮助分级、变量和不变......而不是保留字。

我要再次指出,这是一个可怕的想法。





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签