Hypothesis and equations
Syntax :
result = readStringParameter(fileName, name);
This function demonstrates how a function can be implemented that reads the value of a String parameter from file. The function performs the following actions:
Bibliography
none
Instructions for use
On file "test.txt" the following lines might be present:
// Building data S=100 G=3 V=250 Meteo=trappes.txt
The function returns the value "trappes.txt" when called as:
readRealParameter("test.txt", "Meteo")
Known limits / Use precautions
Be careful, each character after "=" will be returned, included space characters at the beginning.
Validations
Model validated - Hassan Bouia 09/2015--------------------------------------------------------------
Licensed by EDF under a 3-clause BSD-license
Copyright © EDF 2009 - 2023
BuildSysPro version 3.6.0
Author : Hassan BOUIA, EDF (2015)
--------------------------------------------------------------
function readStringParameter extends Modelica.Icons.Function; input String fileName "Name of file" annotation( Dialog(loadSelector(filter = "Text files (*.txt)", caption = "Open file in which Real parameters are present"))); input String name "Name of parameter"; output String result "Actual value of parameter on file"; end readStringParameter;