sayzer
- 6th August 2006, 16:20
Hi there,
I am wondering if there is a much shorter way of doing this?
'VARX is a word.
VARX = 56789
'I need digit4 and digit3 (56) from this number in to a byte variable;
'I do it in this way:
VAR_Fisrt = (VARX DIG 4)*10 + (VARX DIG 3)
'This gives me 56.
'I also need digit2 and digit1 (78) in to another byte variable;
'I do it in this way:
VAR_Second = (VARX DIG 2)*10 + (VARX DIG 1)
' This gives me 78.
Thanks inn advance.
I am wondering if there is a much shorter way of doing this?
'VARX is a word.
VARX = 56789
'I need digit4 and digit3 (56) from this number in to a byte variable;
'I do it in this way:
VAR_Fisrt = (VARX DIG 4)*10 + (VARX DIG 3)
'This gives me 56.
'I also need digit2 and digit1 (78) in to another byte variable;
'I do it in this way:
VAR_Second = (VARX DIG 2)*10 + (VARX DIG 1)
' This gives me 78.
Thanks inn advance.