functionscanInteger
Scan for the next Integer number and trigger an assert if not present
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
number = Strings.scanInteger(string);
(number, nextIndex) = Strings.scanInteger(string, startIndex=1,
unsigned=false, message="");
Description
Function scanInteger scans the string starting at index "startIndex", checks whether the next token is an Integer literal and returns its value as an Integer number, as well as the index directly after the Integer number. An assert is triggered, if the scanned string does not contain an Integer literal with optional leading white space.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | string | String to be scanned | |
| Integer | startIndex | 1 | Start scanning of string at character startIndex |
| Boolean | unsigned | false | = true, if Integer token shall not start with a sign |
| String | message | "" | Message used in error message if scan is not successful |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | number | Value of Integer number | |
| Integer | nextIndex | Index of character after the found number |