WOLFRAM SYSTEM MODELER

scanIdentifier

Scan for the next Identifier and trigger an assert if not present

Wolfram Language

In[1]:=
SystemModel["Modelica.Utilities.Strings.scanIdentifier"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Syntax

             identifier = Strings.scanIdentifier(string);
(identifier, nextIndex) = Strings.scanIdentifier(string, startIndex=1, message="");

Description

Function scanIdentifier scans the string starting at index "startIndex", checks whether the next token is an Identifier and returns its value as a string, as well as the index directly after the Identifier. An assert is triggered, if the scanned string does not contain an Identifier with optional leading white space.

Syntax

(identifier, nextIndex) = scanIdentifier(string, startIndex, message)

Inputs (3)

string

Type: String

Description: String to be scanned

startIndex

Default Value: 1

Type: Integer

Description: Start scanning of identifier at character startIndex

message

Default Value: ""

Type: String

Description: Message used in error message if scan is not successful

Outputs (2)

identifier

Type: String

Description: Value of Identifier

nextIndex

Type: Integer

Description: Index of character after the found identifier