Using the Haxe programming language, is it possible to print the command line arguments that are passed to an application?
I'm trying to re-write this Java program (which simply prints the command line arguments) in Haxe.
public class JavaExample{
public static void main(String[] args){
for(int i = 0; i < args.length; i++){
System.out.println(args[i]);
}
}
}
Since targets like JS(in browser) and Flash do not have concept of command line arguments. Haxe put such "system" target things in Sys and the top level sys package.
class Example {
public static function main():Void {
for (arg in Sys.args())
Sys.println(arg);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With