<GET_COMMAND Example Program>
Program get_command_example Integer n Character(:), Allocatable :: cmd Call Get_Command(Length=n) If (n==0) Then Print *, 'No command found' Else Allocate(Character(n) :: cmd) Call Get_Command(cmd) Print *, 'Command line is "', cmd, '"' End If End Program
■ Execution Results
If the program is called “C:\Example\a.exe” and is invoked as “a simple example” the results are likely to be either:
Command line is "a simple example"or
Command line is "C:\Example\a.exe simple example"(This will depend on the particular command shell in use.)