Command-line arguments is part of Short Circuit's Console Program Basics selection.
Scripted main
See also Program name.

For parsing command line arguments intelligently, see Parsing command-line arguments.

Example command line:

myprogram -c "alpha beta" -h "gamma"

 
MODULE CommandLineArguments;
IMPORT
  NPCT:Args,
  Out := NPCT:Console;
 
BEGIN
  Out.String("Args number: ");Out.Int(Args.Number(),0);Out.Ln;
  Out.String("0.- : ");Out.String(Args.AsString(0));Out.Ln;
  Out.String("1.- : ");Out.String(Args.AsString(1));Out.Ln;
  Out.String("2.- : ");Out.String(Args.AsString(2));Out.Ln;
  Out.String("3.- : ");Out.String(Args.AsString(3));Out.Ln;
  Out.String("4.-: ");Out.String(Args.AsString(4));Out.Ln
END CommandLineArguments.
 