dec_to_oct

Downloaddec_to_oct(dec)   Returns a string of octal digits converted from the given non-negative integer.
/*
**  Usage:
**      dec_to_oct(dec)
**
**  Argument:
**      dec     a non-negative integer
**
**  Returns:
**      a string of octal digits, three bits per character
**
**  GMLscripts.com
*/

{
    var dec,oct,o;
    dec = argument0
    oct = "";
    o = "01234567";
    do {
        oct = string_char_at(o,(dec & 7)+1) + oct;
        dec = dec >> 3;
    } until (dec == 0);
    return oct;
}

Click if you've used this script[Please Login]
Projects: 1


comments powered by Disqus