There are more than 1 ways to generate flags.
NULL functions generate 0 or -1.
You can use if statements to generate a value, any value, that can be used as flag.
In the GUI you can reuse these flags for all kind of expressions, conditions etc.
Too much too list here on the forum.
Like James's question, be more specific please.