functionreadStringParameter
Extends from Modelica.Icons.Function (Icon for functions).
Information
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:
- It opens file "fileName" and reads the lines of the file.
- When the name of the parameter is found, the whole String after "=" is returned.
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)
--------------------------------------------------------------
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | fileName | Name of file | |
| String | name | Name of parameter |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | result | Actual value of parameter on file |