I got an external Library and I found something interesting in their Xojo/RB example.
There are a bunch of Constants
CONSTANT_01 = 2
CONSTANT_02 = 4
and then a Function is Called like this:
aFunction(CONSTANT_01 Or CONSTANT_02)
^ watch the ‘Or’
And the Function looks like this:
[code]Sub aFunction(Optional flags As UInt32 = CONSTANT_01)
Declare Function aFunction Lib aLibrary(ByVal flags As UInt32) As Int32
Dim ret As Int32 = aFunction(flags)
Select Case ret
Case 0 ’ success
Raise New someException
Raise New someOtherException
I had no idea that a Function could be called like this.
Within the function, it seems that the constants are added (flags = 6).
But when I change the ‘Or’ (in the Function Call) to ‘And’, flags = 0.
Is this something handy I missed? How is this normally used? Are there examples in the documentation that explains this and show where this could be useful?