Clicky

Fortran Wiki
get_environment_variable (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

Get the value of the environmental variable name.

(追記)

Note that get_environment_variable need not be thread-safe. It is the responsibility of the user to ensure that the environment is not being updated concurrently with a call to the get_environment_variable intrinsic.

(追記ここまで)
(追記) (追記ここまで)

Standard

Fortran 2003 and later

Class

Subroutine

Syntax

(削除)

call get_environment_variable(name[, value, length, status, trim_name)

(削除ここまで)
(追記)
call get_environment_variable(name[, value, length, status, trim_name)
(追記ここまで)

Arguments

  • name -(追記) (Optional) (追記ここまで) Shall be a scalar of type(削除) character(1) (削除ここまで)(追記) character (追記ここまで)(削除) . (削除ここまで)(追記) (追記ここまで)(追記) and (追記ここまで)(追記) of (追記ここまで)(追記) default (追記ここまで)(追記) kind. (追記ここまで)
  • value -(追記) (Optional) (追記ここまで) Shall be a scalar of type(削除) character(1) (削除ここまで)(追記) character (追記ここまで)(削除) . (削除ここまで)(追記) (追記ここまで)(追記) and (追記ここまで)(追記) of (追記ここまで)(追記) default (追記ここまで)(追記) kind. (追記ここまで)
  • length -(追記) (Optional) (追記ここまで) Shall be a scalar of type(削除) integer(4) (削除ここまで)(追記) integer (追記ここまで)(削除) . (削除ここまで)(追記) (追記ここまで)(追記) and (追記ここまで)(追記) of (追記ここまで)(追記) default (追記ここまで)(追記) kind. (追記ここまで)
  • status -(追記) (Optional) (追記ここまで) Shall be a scalar of type(削除) integer(4) (削除ここまで)(追記) integer (追記ここまで)(削除) . (削除ここまで)(追記) (追記ここまで)(追記) and (追記ここまで)(追記) of (追記ここまで)(追記) default (追記ここまで)(追記) kind. (追記ここまで)
  • trim_name -(追記) (Optional) (追記ここまで) Shall be a scalar of type(削除) logical(4) (削除ここまで)(追記) logical (追記ここまで)(削除) . (削除ここまで)(追記) (追記ここまで)(追記) and (追記ここまで)(追記) of (追記ここまで)(追記) default (追記ここまで)(追記) kind. (追記ここまで)

Return value

Stores the value of name in value. If value is not large enough to hold the data, it is truncated. If name is not set, value will be filled with blanks. Argument length contains the length needed for storing the environment variable name or zero if it is not present. status is -1 if value is present but too short for the environment variable; it is 1 if the environment variable does not exist and 2 if the processor does not support environment variables; in all other cases status is zero. If trim_name is present with the value .false., the trailing blanks in name are significant; otherwise they are not part of the environment variable name.

Example

program test_getenv
 character(len=255) :: homedir
 call get_environment_variable((削除) "home" (削除ここまで)(追記) "HOME" (追記ここまで), homedir)
 write (*,*) trim(homedir)
end program

category: intrinsics

Revised on April 4, 2016 13:42:43 by Jason Blevins (128.146.137.52) (1986 characters / 0.0 pages)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, OS integration

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