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

TypeNameDefaultDescription
StringstringString to be scanned
IntegerstartIndex1Start scanning of string at character startIndex
Booleanunsignedfalse= true, if Integer token shall not start with a sign
Stringmessage""Message used in error message if scan is not successful

Outputs

TypeNameDefaultDescription
IntegernumberValue of Integer number
IntegernextIndexIndex of character after the found number