command_argument_count(): Number of Command Line Arguments

Get number of command line arguments.

Declaration

Syntax

retval = command_argument_count()
function command_argument_count()

Arguments

None.

Return values

The return value is of integer type and of default kind.

Описание

command_argument_count() returns the number of arguments passed on the command line when the named program was invoked.

Types

Any.

Examples

program intrinsics_command_argument_count
    implicit none
	print *, command_argument_count()
end program

Result:

intrinsics_command_argument_count a b
2

See Also