[UP]


Manual Reference Pages  - command_argument_count (3)

NAME

command_argument_count(3f) - [FORTRAN:INTRINSIC:SYSTEM ENVIRONMENT] Get number of command line arguments

SYNTAX

result = command_argument_count()

     integer :: result

DESCRIPTION

command_argument_count returns the number of arguments passed on the command line when the containing program was invoked.

ARGUMENTS

None

RETURN VALUE

RESULT The return value is of type default integer. It is the number of arguments passed on the command line when the program was invoked.

EXAMPLE

Sample program:

   program demo_command_argument_count
   implicit none
   integer :: count
       count = command_argument_count()
       print *, count
   end program demo_command_argument_count

Sample output:

   # the command verb does not count
   ./test_command_argument_count
       0
   # quoted strings may count as one argument
   ./test_command_argument_count count arguments
       2
   ./test_command_argument_count ’count arguments’
       1

STANDARD

[[Fortran 2003]] and later

CLASS

[[Inquiry function]]

SEE ALSO

get_command(3), get_command_argument(3)

    JSU


command_argument_count (3) March 11, 2021
Generated by manServer 1.08 from f3bba389-d9cc-41b3-ace1-d5f83e82f1fe using man macros.