I need a split function equivalent
johnnycarlos
Posts: 44
Hi Everyone,
Still new to Spin, but I've learned a lot this week. My next project has hit a snag because I need to find the equivalent of a "split" function. Here is what I am trying to do, I have a byte variable like:
wholeVar = 73
and I want to split it into two variables as such:
splitVar1 := 7
splitVar2 := 3
or stored in an array that I can walk through. Or, any other way that I can retrieve the digits. Any ideas?
I am committed to mastering Spin. So some day I'll be answering these questions instead of asking them [noparse]:)[/noparse]
Thanks for your help.
John
Still new to Spin, but I've learned a lot this week. My next project has hit a snag because I need to find the equivalent of a "split" function. Here is what I am trying to do, I have a byte variable like:
wholeVar = 73
and I want to split it into two variables as such:
splitVar1 := 7
splitVar2 := 3
or stored in an array that I can walk through. Or, any other way that I can retrieve the digits. Any ideas?
I am committed to mastering Spin. So some day I'll be answering these questions instead of asking them [noparse]:)[/noparse]
Thanks for your help.
John
Comments
splitVar2 := wholeVar1 // 10
-Phil
Thanks!
John