
Originally Posted by
therian, The Rian who asked the question
Dig is great function but how to find out how many digits in the number if you dont know it, and what Dig function will do if you try to asses position what do not exist ?
W0 = 54321
B1 = W0 DIG 6 <---?
What I get from the question is this:
W0 is WORD
Say W0 = 23.
That makes it W0 = 00023.
IF you want to know which digits are NOT zero then you need a "check" routine.
Example: W1 = 00103. We have two zeros we do not need. So DIG3 and DIG4 are not required to be read (for some logical reason!)
I think this is what the question was asking.
In that case, starting from Left to Right, we have a check routine.
Code:
IF W1 DIG 4 = 0 THEN
IF W1 DIG 3 = 0 THEN
...
ELSE
'Do something....
ELSE
'Do something....
....
etc.
Do I make dead comments again?
Bookmarks