Task

Produce a sequential count in octal,   starting at zero,   and using an increment of a one for each consecutive number.

Each number should appear on a single line,   and the program should count until terminated,   or until the maximum value of the numeric type in use is reached.



Related task

   Integer sequence   is a similar task without the use of octal numbers.


 
    'the method used here uses the base-conversion from RC Non-decimal radices/Convert
    'to terminate hit <CTRL<BRK>
 
    global      alphanum$
    alphanum$   ="01234567"
 
    i =0
 
    while 1
        print toBase$( 8, i)
        i =i +1
    wend
 
    end
 
    function toBase$( base, number) '   Convert decimal variable to number string.
        maxIntegerBitSize   =len( str$( number))
        toBase$             =""
        for i =10 to 1 step -1
            remainder   =number mod base
            toBase$     =mid$( alphanum$, remainder +1, 1) +toBase$
            number      =int( number /base)
            if number <1 then exit for
        next i
        toBase$ =right$( "             " +toBase$, 10)
    end function
 