STRING
Function
String contains procedures for manipulating character strings.
Dependencies
Module | Variables |
DEFINITIONS | DP, LINE_LENGTH |
STATUS | ERROR |
Public Variables
None.
Public Procedures
There are four public functions and a single public subroutine in this module.
Function | Type | Purpose |
DECODE_INTEGER | Integer | Decode an integer from a string. |
DECODE_LOGICAL | Logical | Decode a logical from a string. |
DECODE_REAL | Real | Decode a real number from a string. |
TO_UPPER_CASE | Character | Convert the alphabetic characters in a string to upper case. |
Subroutine | Purpose |
ENCODE_INTEGER | Convert an integer into a string. |
DECODE_INTEGER
Argument | Type | Intent | Optional | Purpose |
STRING | Character | In | No | The string from which the integer is to be decoded. |
Error | Meaning |
I/O Error. | There has been an error either because the integer is too long or because the string
does not encode a valid integer. |
- If the input string has zero length then the function returns the value of zero.
DECODE_LOGICAL
Argument | Type | Intent | Optional | Purpose |
STRING | Character | In | No | The string from which the logical is to be decoded. |
Error | Meaning |
Unable to decode string to a logical. | The string does not encode a valid logical. |
- Valid forms for a logical which are recognized by this function are "F", ".F.", ".FALSE.", "T", ".T." and ".TRUE.".
DECODE_REAL
Argument | Type | Intent | Optional | Purpose |
STRING | Character | In | No | The string from which the real is to be decoded. |
Error | Meaning |
I/O Error. | There has been an error either because the real number is too long or because the string
does not encode a valid real number. |
- If the input string has zero length then the function returns the value of zero.
- Valid forms for a real number which are recognized by this function include "3", "3.0", "3.0e2", "3.0e+2", "3.0E-2", etc.
TO_UPPER_CASE
Argument | Type | Intent | Optional | Purpose |
STRING | Character | In | No | The string whose characters are to be converted to upper case. |
- The function result has the same length as the input string.
- Only lower case alphabetic characters are altered.
ENCODE_INTEGER
Argument | Type | Intent | Optional | Purpose |
NUMBER | Integer | In | No | The integer to be encoded. |
STRING | Character | Out | No | The string containing the encoded integer. |
FORMAT | Character | In | Yes | The encoding format to use. |
Error | Meaning |
String is too short to hold the encoded integer. | The variable STRING is too short to hold the integer. |
- If the argument FORMAT is not specified then a default format of "(I20)" is used.
Stability
Stable.