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"

// The program name and the directory it was called from are in
// param[0] , so given the axample of myprogram -c "alpha beta" -h "gamma"
 
  for x := 0 to paramcount do
      writeln('param[',x,'] = ',param[x]);
 
// will yield ( assuming windows and the c drive as the only drive) :
 
//  param[0] = c:\myprogram
//  param[1] = -c
//  param[2] = alpha beta
//  param[3] = -h
//  param[4] = gamma
 