getFirstName function

Requirements.Internal.getFirstName  ยท source

Icon of getFirstName

Get first name of a Modelica path name

Extends Modelica.Icons.Function

Returns the first name of the Modelica path name path, the part before the first dot: getFirstName("Root.a.b") = "Root". If path contains no dot, path is returned; if it starts with a dot, the empty string. The counterpart is removeFirstName.

Applied to getInstanceName(), it gives the name of the simulated root model. Verify.PrintViolations uses it for the default names of the log file and the HTML report (<root name>_log.txt, <root name>_log.html) and for the heading of the summary; the FFT blocks of ChecksInFixedWindow_withFFT use it for the name of their result directory.

Inputs

NameTypeDescription
path inputStringModelica path name, e.g. \"Root.a.b\"

Outputs

NameTypeDescription
head outputString= path upto but not including the first \".\" (if \".\" not present, head=path)