On Fri, Feb 6, 2015 at 10:18 AM, Roelof Wobben <r.wobben@home.nl> wrote:
Can someone give me a tip how to solve this
I have asked this on the beginners ML but the only answer I get was someone who was using some if -then statement and I think I can be solved without.

You need to distinguish three "zero" cases:

- the value is itself zero
- leading zero (i.e. you hit the end of available digits)
- interior zero

The middle one is your end case --- but this will give you no output if the value you put in initially is zero, since you're already at the end case. So you need to treat an initial value of 0 specially somehow to get output for it. So, either an explicit conditional or a setup where the public function handles an explicit zero and otherwise defers to what you have, which becomes an internal/hidden function (via where or let).

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net