A 
		
				
			
		Arifudin Myf
Guest
- how do I change the code below from octal to binary and from binary to octal ..?? Help me. Thank you.
 
this convert oktal to desimal
		Code:
	
	def var desok as char.
def var ok as int LABEL "Input Oktal".
def var des as int LABEL "Hasil Output Desimal".
def var i as int.
i = 0.
prompt-for ok.
assign ok.
DO while ok > 0:
    des = (ok MOD 10) * EXP(8, i) + des.
    ok = truncate(ok / 10, 0).
    i = i + 1.
end.
display des.
/**/
	next code
this for convert biner
		Code:
	
	    function getBinary returns char (input nilai as int) forward.
    display getBinary(des) LABEL "Hasil Biner".
    function getBinary returns char (input nilai as int):
    DO WHILE nilai > 0:
    assign
    desok  =  string( nilai MOD 2 ) + desok
    nilai =  TRUNCATE( nilai / 2, 0 ).
    end.
    IF desok = "" THEN desok ="0":U.
    return desok.
    end function.
	Continue reading...