  function OCTDEC( OCTVAL:INTEGER ) : INTEGER;
    var DECIMAL    : INTEGER;
        REMAINDER  : INTEGER;
        NEWVAL     : INTEGER;
    begin
      DECIMAL := OCTVAL mod 8;
      REMAINDER := OCTVAL div 8;
      if REMAINDER#0 then
       begin
        NEWVAL := OCTDEC(REMAINDER);
        NEWVAL := 10 * NEWVAL;
        DECIMAL := DECIMAL + NEWVAL
       end;
      OCTDEC := DECIMAL;
    end;
