gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dc_string::stoi Interface Reference

Public Member Functions

integer function atoi_scalar (string, default)

Detailed Description

Definition at line 111 of file dc_string.f90.

Member Function/Subroutine Documentation

◆ atoi_scalar()

integer function dc_string::stoi::atoi_scalar ( character(len = *), intent(in) string,
integer, intent(in), optional default )

文字列を整数に変換

string で与えられる文字型変数を、整数型変数にして返します。 もしも string が数値に変換できない場合、default が返ります。 default を指定しない場合は 0 が返ります。

Parameters
[in]string変換する文字列
[in]default変換失敗時のデフォルト値(省略可能)
Returns
整数値

Definition at line 645 of file dc_string.f90.

646 character(len = *), intent(in):: string
647 integer, intent(in), optional:: default
648 integer:: ios
649 continue
650 read(unit=string, fmt="(i80)", iostat=ios) result
651 if (ios /= 0) then
652 if (present(default)) then
653 result = default
654 else
655 result = 0
656 endif
657 endif

References dc_types::string.


The documentation for this interface was generated from the following file: