.BuildSysPro.Utilities.Analysis.readStringParameter

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:

  1. It opens file "fileName" and reads the lines of the file.
  2. 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)
--------------------------------------------------------------

Interface

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;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos