5. System interface

We show how to get at the command line arguments. The function 'argv' returns an empty string if the argument index is out of range. argv 0 is usually the program name: for the flx_run driver it's the loaded library name: the driver name and control arguments are stripped. (Note: the output is platform dependent and so can't be automatically checked by the Felix build system.)
#import <flx.flxh>
open System;
print "argc="; print argc; endl;

var i:int;
for_each {i=0;} {i<argc} {++i;}
{
  print i; print "->"; print (argv i); endl;
};