how do i prompt for user input in a running function?
+2
A:
to read a line from standard input, I think you can just do something like
TextIO.inputLine TextIO.stdIn
newacct
2010-04-23 05:39:32
+2
A:
My code looks something like this:
fun get infile = ( TextIO.output(TextIO.stdOut, prompt)
; TextIO.flushOut(TextIO.stdOut)
; TextIO.inputLine infile
)
This returns a value of type string option
; normally a line SOME l
, but NONE
on end of file.
Norman Ramsey
2010-04-23 06:01:28