Can digitalWrite be used in Global or Setup?

Can a digitalWrite statement be used setup global?

Documentation doesn't say it can't.

What do you mean by "In Global"?

Not in setup or loop.

Generally speaking, executable code must be inside a function.

Got it.

So has to be in setup or loop or some other function.