[英]How to use Delphi “in” operator in C++ Builder
I'm a newbie programmer. 我是新手程序员。 I need to use Delphi's
in
operator in C++ Builder XE like this: 我需要使用Delphi的
in
运营商在C ++ Builder的XE是这样的:
if (dgColLines in DBGrid->Options)
// include vertical lines in total (one per column)
TotalColumnWidth = TotalColumnWidth + ColumnCount;
if (dgColLines **in** DBGrid->Options)
How to do that in C++ Builder? 如何在C ++ Builder中做到这一点?
Thanks in advance. 提前致谢。
Looking the the property in question, TDBGrid.Options
, its type is TDBGridOptions
which is defined as: 查看有问题的属性
TDBGrid.Options
,其类型为TDBGridOptions
,定义为:
typedef System::Set<TDBGridOption, TDBGridOption::dgEditing,
TDBGridOption::dgTitleHotTrack> TDBGridOptions;
As you can see, C++ Builder uses the template System::Set<T, minEl, maxEl>
to emulate Delphi set types. 如您所见,C ++ Builder使用模板
System::Set<T, minEl, maxEl>
来模拟Delphi集类型。
All of the functionality available using the built in Delphi set operators is exposed through the methods of Set
. 使用内置的Delphi集合运算符提供的所有功能都通过
Set
的方法公开。 Specifically to this question, set membership is testing using Contains()
. 具体到这个问题,设置成员资格正在使用
Contains()
进行测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.