functionscanReal

Scan for the next Real number and trigger an assert if not present

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

             number = Strings.scanReal(string);
(number, nextIndex) = Strings.scanReal(string, startIndex=1,
                                            unsigned=false, message="");

Description

The first form, "scanReal(string)", scans "string" for a Real number with leading white space and returns the value.

The second form, "scanReal(string,startIndex,unsigned)", scans the string starting at index "startIndex", checks whether the next token is a Real literal and returns its value as a Real number, as well as the index directly after the Real number. If the optional argument "unsigned" is true, the real number shall not have a leading "+" or "-" sign.

If the required Real number with leading white space is not present in "string", an assert is triggered.

Inputs

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

Outputs

TypeNameDefaultDescription
RealnumberValue of real number
IntegernextIndexIndex of character after the found number