Question

I'd like to create utility that should be able to listen standard input and stream to standard output. Moreover I'd like to get command line arguments passed to utility. Is it possible to do with haxe/cpp environment?

What "trace()" exactly do? Can I override it's auto CR/LF with some ascii control characters to print pseudographical activity gauges?

Was it helpful?

Solution

I think that the trace function is inteded to be used only for debug, i think that's why it prints the file and the row from which you called it.

What I think you really want is Lib.print() and Lib.printl() to write something to the console.

For reading I didn't find a function as easy as that, but it's still easy enough, here's an example:

    var stdin  = Sys.stdin();
    var string : String = stdin.readLine();

If you want to look more into console development in haxe I'd suggest you to look into some projects that uses them, for example to write this question I've read this file https://github.com/ianxm/ihx/blob/master/src/ihx/ConsoleReader.hx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top