Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun printToOutStream (outstream, str) = let val os = outstream
- in
- TextIO.output(os,str ^ "\n");
- TextIO.closeOut os
- end;
- val os = TextIO.openOut "output.txt";
- fun ascii (count_end) =
- let
- val n = ref 0
- val str = ref ""
- in
- while !n < count_end do (
- str := Int.fmt StringCvt.DEC (!n) ^ " " ^ Int.fmt StringCvt.OCT (!n) ^ " "
- ^ Int.fmt StringCvt.HEX (!n) ^ " " ^ Int.fmt StringCvt.BIN (!n);
- printToOutStream(os, !str);
- print( Int.fmt StringCvt.DEC (!n) ^ "\t"
- ^ Int.fmt StringCvt.BIN (!n) ^ "\t"
- ^ Int.fmt StringCvt.OCT (!n) ^ "\t"
- ^ Int.fmt StringCvt.HEX (!n) ^ "\n"
- );
- printToOutStream(os, !str);
- n := !n + 1
- )
- end;
- ascii(16);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement