RosettaCodeData/Task/Count-in-octal/BASIC/count-in-octal-2.basic

16 lines
250 B
Text
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
WHILE ("" = INKEY$)
PRINT Octal$(n)
n = n + 1
WEND
END
FUNCTION Octal$(what)
outp$ = ""
w = what
WHILE ABS(w) > 0
o = w AND 7
w = INT(w / 8)
outp$ = STR$(o) + outp$
WEND
Octal$ = outp$
END FUNCTION