numerical types
jrem
Posts: 4
Folks, I'm pulling my hair out on this one. I'm understanding that the default numerical values are DEC, but when I use a DEC value in LOOKUP (my lookup values are hex) I get jibberish.
My code is something like this:
tempx=50
digit_a=tempx.NIB0
digit_b=tempx.NIB1
LOOKUP digit_a, [noparse][[/noparse]$00, $00, $e6, $fe, $e0, $3e, $b6, $66, $f4, $dc, $60, $fa], pattern_a
LOOKUP digit_b, [noparse][[/noparse]$00, $00, $e6, $fe, $e0, $3e, $b6, $66, $f4, $dc, $60, $fa], pattern_b
I expect pattern_a to be $00 and pattern_b to be $e0, but it doesn't appear work out.
Any clues? Thanks . . .
My code is something like this:
tempx=50
digit_a=tempx.NIB0
digit_b=tempx.NIB1
LOOKUP digit_a, [noparse][[/noparse]$00, $00, $e6, $fe, $e0, $3e, $b6, $66, $f4, $dc, $60, $fa], pattern_a
LOOKUP digit_b, [noparse][[/noparse]$00, $00, $e6, $fe, $e0, $3e, $b6, $66, $f4, $dc, $60, $fa], pattern_b
I expect pattern_a to be $00 and pattern_b to be $e0, but it doesn't appear work out.
Any clues? Thanks . . .
Comments
NIB0 takes the least significant 4 bits of the number. In your case, this is a two. The LOOKUP will produce $e6 for this.
NIB1 takes the most significant 4 bits of the number. In your case, this is a three. The LOOKUP will produce $fe for this.
edit: vroom through the submission button, Mike... [noparse]:)[/noparse]