If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Assuming you're working with digital numbers, the obvious way would be to iterate through the list multiplying the current value by 10 and adding the new digit.
I don't know what language you're using, but a AppleScript-based model could be:
Code:
set theList to {"5", "1", "2"}
set theResult to 0
repeat with i from 1 to (number of items in theList)
set theResult to theResult * 10
set theResult to theResult + (item i of theList as number)
end repeat
theResult
I've used AppleScript as an example because it's the easiest to understand and therefore translate into other languages, but the principle should be the same.
Of course, good code would add error handling, bounds checking, etc.
Gods don't kill people - people with Gods kill people.