Reputation: 31800
In the Haxe programming language, is there anything equivalent to Java's scanner class (which reads input from the command line?) I'd like to find some way of reading text input from the command line.
Upvotes: 1
Views: 156
Reputation: 6008
Sys.stdin().readLine()
is what you're looking for.
Here's an example from http://haxe.org/doc/start/neko#reading-user-input:
class Main {
static function main() {
Sys.println("What's your name?");
var input = Sys.stdin().readLine();
Sys.println(Std.format("Hello ${input}"));
Sys.exit(0);
}
}
Upvotes: 2