Or is it supposed to work the way I'm seeing it work? Let me show a simple example:
A~%% = _SetBit(A~%%, 6) 'set the seventh bit of A~%%
B~%% = _SetBit(A~%%, 2) 'set the second bit of A~%%
? A~%%, B~%%
Now, from my understanding, this should simply set a bit for a variable. If we print the results, we see that A = 64 and B = 68...
From our results, it shows that what we're doing is copying the value of our internal variable, and then setting a bit over its existing values, and then we're returning that modified value back to our return variable -- which doesn't seem to be what this simple routine was meant to do at all!
Shouldn't this be a simple SUB, which we just call to set a bit?
_SETBIT variable, bit, (optional value for 0 or 1)?
Why is this a FUNCTION that only works when the return variable is the same as our internal variable? Something with this just seems intrinsically overly complicated and non-intuitive to me.