<Example Program>

Program command_argument_count_example
  Integer i, n
  Character(80) arg
  n = Command_Argument_Count()
  If (n==0) Print *, 'No argument found'
  Do i=1, n
    Call Get_Command_Argument(i,arg)
    Print *, 'Argument',i,'is "',Trim(arg),'"'
  End Do
End Program

■ Execution Results

If invoked with no argument, the results are:

 No argument found

If the program is called “a” and is invoked as “a simple example” the results are:

 Argument 1 is "simple"
 Argument 2 is "example"