我正在尝试过滤我的日志记录。如果选项中有日志(或消息)类型,我想将其发送到日志,否则退出。
编译在“if not MessageType in...”行上失败:
"[dcc32 Error] uMain.pas(2424): E2015 Operator not applicable to this operand type"
我认为基于 Include/Exclude 函数必须是可能的(并且相当简单),我尝试查看但找不到任何地方(即 Include(MySet, llInfo); )。
我的声明如下:
type
TLogLevel = (llDebug, llError, llWarn, llInfo, llException);
TLogOptions = set of TLogLevel;
var
FLogOptions: TLogOptions;
procedure TfrmMain.Log(const s: String; MessageType: TLogLevel;
DebugLevel: Integer; Filter: Boolean = True);
begin
if not MessageType in FLogOptions then
exit;
mmoLog.Lines.Add(s);
end;
Run Code Online (Sandbox Code Playgroud) 我在Windows 7 x64上安装了Delphi 7.事情顺利进行,但现在,当我打开或创建数据模块时,它会混乱组件调色板.通过搞砸,我的意思是它似乎在争夺哪个标签组件,或者完全隐藏它们.这是非常不寻常的行为.
卸载并重新安装Delphi 7没有帮助.