Bitwise flags in Delphi

前端 未结 3 1592
南方客
南方客 2020-12-16 16:39

I need to check if a certain flag is set for an integer.

I already know how to set a flag:

flags := FLAG_A or FLAG_B or FLAG_C

But

3条回答
  •  孤城傲影
    2020-12-16 17:25

    You use the and operator as you would & in C++. On numeric arguments, it's bitwise. Here are some examples of bitwise operations.

提交回复
热议问题