.Modelica.Utilities.Strings.scanBoolean

Information

Syntax

             number = Strings.scanBoolean(string);
(number, nextIndex) = Strings.scanBoolean(string, startIndex=1, message="");

Description

Function scanBoolean scans the string starting at index "startIndex", checks whether the next token is a Boolean literal (i.e., is either the string "false" or "true", if converted to lower case letters) and returns its value as a Boolean number, as well as the index directly after the Boolean number. An assert is triggered, if the scanned string does not contain a Boolean literal with optional leading white space.

Interface

function scanBoolean
  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 String message = "" "Message used in error message if scan is not successful";
  output Boolean number "Value of Boolean";
  output Integer nextIndex "Index of character after the found number";
end scanBoolean;

Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos