Clicky

Fortran Wiki
get_command (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #2 to #3: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

Retrieve the entire command line that was used to invoke the program.

Standard

Fortran 2003 and later

Class

Subroutine

Syntax

(削除)

call get_command(command)

(削除ここまで)
(追記)
call get_command([command, length, status])
(追記ここまで)

Arguments

  • command -(削除) Shall (削除ここまで)(追記) (Optional) (追記ここまで)(追記) shall (追記ここまで) be of typecharacter and of default kind.
  • (追記) (追記ここまで)(追記)
  • length - (Optional) Shall be of type integer and of default kind.
  • (追記ここまで)
    (追記) (追記ここまで)(追記)
  • status - (Optional) Shall be of type integer and of default kind.
  • (追記ここまで)

Return value

(削除) Stores (削除ここまで)(追記) If (追記ここまで)(削除) the (削除ここまで)(削除) entire (削除ここまで)(削除) command (削除ここまで)(削除) line (削除ここまで)(削除) that (削除ここまで)(削除) was (削除ここまで)(削除) used (削除ここまで)(削除) to (削除ここまで)(削除) invoke (削除ここまで)(削除) the (削除ここまで)(削除) program (削除ここまで)(削除) in (削除ここまで)command(削除) . (削除ここまで)(追記) (追記ここまで)(削除) If (削除ここまで)(追記) is (追記ここまで)(追記) present, (追記ここまで)(追記) stores (追記ここまで)(追記) the (追記ここまで)(追記) entire (追記ここまで)(追記) command (追記ここまで)(追記) line (追記ここまで)(追記) that (追記ここまで)(追記) was (追記ここまで)(追記) used (追記ここまで)(追記) to (追記ここまで)(追記) invoke (追記ここまで)(追記) the (追記ここまで)(追記) program (追記ここまで)(追記) in (追記ここまで)command(削除) (削除ここまで)(追記) . (追記ここまで)(削除) is (削除ここまで)(追記) If (追記ここまで)(削除) not (削除ここまで)(削除) large (削除ここまで)(削除) enough, (削除ここまで)(削除) the (削除ここまで)(削除) command (削除ここまで)(削除) will (削除ここまで)(削除) be (削除ここまで)(削除) truncated. (削除ここまで)(追記) length (追記ここまで)(追記) is present, it is assigned the length of the command line. If (追記ここまで)(追記) status (追記ここまで)(追記) is present, it is assigned 0 upon success of the command, -1 if (追記ここまで)(追記) command (追記ここまで)(追記) is too short to store the command line, or a positive value in case of an error. (追記ここまで)

Example

program test_get_command
 character(len=255) :: cmd
 call get_command(cmd)
 write (*,*) trim(cmd)
end program

See also

get_command_argument, command_argument_count

category: intrinsics

Revised on April 4, 2016 13:09:49 by Jason Blevins (128.146.137.52) (1219 characters / 0.0 pages)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, command_argument_count, get_command_argument, OS integration, Command-line arguments

AltStyle によって変換されたページ (->オリジナル) /