首页 > 解决方案 > 快速找到完全限定的单位名称?

问题描述

我喜欢在Uses语句中尽可能使用完全限定的单位名称:

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

但我并不总是知道这一点。例如,在介绍了Min()函数之后,我不知道数学单元的完全限定名称是什么,所以我只是添加了

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Math;

是否有快速找到完全限定名称的技巧?

相关: Delphi 中的命名空间,在 Delphi使用“System.SysUtils”还是“SysUtils”?

标签: delphinamespaces

解决方案


只需将鼠标光标悬停在单位名称上,例如Math,在uses 语句中。应出现
带有完全限定单位名称 ( ) 的工具提示。System.Math


推荐阅读