gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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 
)

Convert string to integer

Converts the character variable string to integer. If string cannot be converted, returns default (or 0 if not specified).

Parameters
[in]stringString to convert
[in]defaultDefault value if conversion fails (optional)
Returns
Integer value

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: