delphisetc++builderc++builder-xe

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:

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?

Thanks in advance.


Solution

  • Use the Contains method to check if a set contains a specific element:

    if( DBGrid->Options.Contains(dgColLines) )
      TotalColumnWidth = TotalColumnWidth + ColumnCount;