Haxe - print command line arguments

Using the Haxe programming language, is it possible to print the command line arguments passed to the application?

I am trying to rewrite this Java program (which simply prints 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]); } } } 
+4
source share
1 answer

Since targets such as JS (in the browser) and Flash do not have the concept of command line arguments. Haxe has set such "system" goals in Sys and the top-level sys package.

 class Example { public static function main():Void { for (arg in Sys.args()) Sys.println(arg); } } 
+7
source

Source: https://habr.com/ru/post/1442903/


All Articles