Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

from-octal (See related posts)

    from-octal: func [
        "Converts an octal number to a decimal value."
        octal [any-string! integer!]
        /local result len
    ][
        result: 0
        octal: form octal
        repeat i len: length? octal [
            result: add result (to integer! form octal/:i) * (8 ** (len - i))
        ]
        any [attempt [to integer! result] result]
    ]

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts