Clicky

Fortran Wiki
command_argument_count

Description

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

Standard

Fortran 2003 and later

Class

Inquiry function

Syntax

result = command_argument_count()

Arguments

None

Return value

The return value is of type integer(4)

Example

program test_command_argument_count
    integer :: count
    count = command_argument_count()
    print *, count
end program test_command_argument_count

See also

get_command, get_command_argument

category: intrinsics