.Modelica.Utilities.Strings.scanInteger

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.

Interface

function scanInteger
  extends Modelica.Icons.Function;
  input String string "String to be scanned";
  input Integer startIndex(min = 1) = 1 "Start scanning of string at character startIndex";
  input Boolean unsigned = false "= true, if Integer token shall not start with a sign";
  input String message = "" "Message used in error message if scan is not successful";
  output Integer number "Value of Integer number";
  output Integer nextIndex "Index of character after the found number";
end scanInteger;

Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f