Hi @Oliver.Rinn ,
I know bit manipulation seems a bit daunting but once you get used to it, it is quite powerful. Note that as the time of this original post we had less global variables available. We had 360 available at the time, but in the current version (v1.9.1) it is now 710.
With that said, bit mapping is still quite useful in some cases as it can actually be more efficient.
Now to your questions. Say that you have the global variable ga set up to store 4 cc’s as I described earlier.
//Let’s extract the lower byte into the local variable oo
oo=ga&0x7f
Now the next byte into the local variable pp
pp=ga>>8
pp=pp&0x7f
Now the next higher byte into the local variable qq
qq=ga>>16
qq=qq&0x7f
Finally the highest order byte into the local variable rr
rr=ga>>24
rr=rr&0x7f
The last construct is simply to ensure that that we never set bit 7 (the eighth bit) to a 1.
As a side note, if you use the following rules and save your project file, when you come back, it will change your rules to decimal so
oo=oo&0x7f
will show as
oo=oo&127
You can refer to this post with more detail on bitwise operations.
I’m also finding with the new ‘Perform’ feature of version 1.9.1, I often do not need as many global variables because we can pass parameters between translators with out needed to touch global variables.
Steve Caldwell
Bome Customer Care
Also available for paid consulting services: bome@sniz.biz