Question

I cannot understand what this code is doing and I found no documentation about it.

if FComponentState * [csDesigning, csInline] = [csDesigning, csInline] then
Was it helpful?

Solution

the * operator represents the intersection of two sets and is documented in the official documentation of Delphi (see Set Operators).

OTHER TIPS

The set intersection operator * has been part of Pascal since its inception.

This particular example checks that both elements are present in the set.

As mentioned already * gives the intersection of two sets.

if FComponentState * [csDesigning, csInline] = [csDesigning, csInline] then checks if both csDesigning and csInline are in FComponentState. It does so by first getting the intersection between FComponentState and [csDesigning, csInline] and than verify that it is the same as [csDesigning, csInline].

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top