Text

Using the read(Type) built-in function:

var s = read(String)
var i = read(Number)     # auto-conversion to a number

or using the Sys.readln(msg) method:

var s = Sys.readln("Enter a string: ")
var i = Sys.readln("Enter a number: ").to_i

Last updated