DonManfred Expert Licensed User Longtime User Mar 3, 2019 #1 Working with Bits is not my strong part. So i am asking for a bit of help here Given the Documentation of my Printer is like this: I now need to define ONE Value with the Bits 0 to 3 used for the Characterwidth and the Bits 4 to 7 for the Heigth. Can anyone give me some hints on how i would realize this?
Working with Bits is not my strong part. So i am asking for a bit of help here Given the Documentation of my Printer is like this: I now need to define ONE Value with the Bits 0 to 3 used for the Characterwidth and the Bits 4 to 7 for the Heigth. Can anyone give me some hints on how i would realize this?
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2019 #2 Try this: B4X: Dim Height As Int = 5 '0 - 7 Dim Width As Int = 2 '0 - 7 Array As Byte(0x1d, 0x21, Bit.Or(Height, Bit.ShiftLeft(Width, 4)) Upvote 0
Try this: B4X: Dim Height As Int = 5 '0 - 7 Dim Width As Int = 2 '0 - 7 Array As Byte(0x1d, 0x21, Bit.Or(Height, Bit.ShiftLeft(Width, 4))
DonManfred Expert Licensed User Longtime User Mar 3, 2019 #3 Erel said: Try this Click to expand... GREAT It works like a charm Thank you very much! Upvote 0