47498Re: [LIBERTYBASIC] Possibly dumb question
- May 4 11:13 AMAm 02.05.2014 23:56, schrieb Fred Jensen:
> On 5/1/2014 5:26 PM, Jackie McBride wrote:Why make things so complicated?
>> That was indeed funny, Fred. Each of those hex digits represents a
>> nibble. So, you use a struct to decode each hex digit into 4 bits,
>> whose on/off state is either 0 or 1). Does that help?
> Yes, it does and thanks. One of my problems with this project is moving
> between C and LB. Using a struct bit-field and a union is what I would
> have done in C. Never used that in LB ... in fact didn't really realize
> it existed.
> So would it be:
> struct hex_digit, bit3 as boolean, bit2 as boolean -
> bit1 as boolean, bit 0 as boolean
> Move each of the 10 "higits" to hex_digit and test the three Booleans?
40 bits divided by 8 bits per byte will result in 5 bytes of information.
Using the information at
http://www.b6sw.com/forum/content.php?mode=hints&t=235 it should be easy
to find a data type that suits both C and LB.
LB 4.04 Pro ... http://www.libertybasic.com/assist.html
LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
LB Community Wiki .............. http://basic.wikispaces.com/
LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC
Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM
- << Previous post in topic