Converts a character string containing an integer number into the corresponding integer form.
STRING — Character string containing an integer number. (Input)
NUMBER — The integer equivalent of STRING. (Output)
Generic: CALL CVTSI (STRING, NUMBER)
Specific: The specific interface name is CVTSI.
Single: CALL CVTSI (STRING, NUMBER)
Routine CVTSI converts a character string containing an integer to an INTEGER variable. Leading and trailing blanks in the string are ignored. If the string contains something other than an integer, a terminal error is issued. If the string contains an integer larger than can be represented by an INTEGER variable as determined from routine IMACH (see the Reference Material), a terminal error is issued.
The string “12345” is converted to an INTEGER variable.
USE CVTSI_INT
USE UMACH_INT
IMPLICIT NONE
INTEGER NOUT, NUMBER
CHARACTER STRING*10
!
DATA STRING/'12345'/
!
CALL CVTSI (STRING, NUMBER)
!
CALL UMACH (2, NOUT)
WRITE (NOUT,*) 'NUMBER = ', NUMBER
END
NUMBER = 12345
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |