BitMask is a binary number with a 1 where you want the flag to be, so for the 4th bit it's %00000000000000000000000000010000:Int
Question: is %00000000000000000000000000000001 correct
Yes - that's a value of 1. I think ImaginaryHuman has confused you by saying the 4th bit, when his example has the 5th bit set.%00000010 is 2, %00000011 is 3 (bits 2+1), %00000100 is 4, %00000101 is 5 (bits 4+1) and so on.
You can use Print Bin(value) to show a binary representation of an integer.
Also you don't need all those leading zeros. %00000000000000000000000000000001 is the same as %1. Everything to the left of the 1 is implied as zero.