Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

read file as a Real

read file as a Real

Hi,
I have below test.txt

2.33
3.45
2

I am read firts line of file (2.33)   with  Streams.readLine() commands.
Return value of this command  a string. But actually this value is Real parameter.
How can read this value as a Real variable?
OM have stringtoReal function or something?

Thanks

oki

Re: read file as a Real

https://build.openmodelica.org/Document … nReal.html
OpenModelica has a stringReal function if you use the MetaModelica extensions, but you probably don't want that.

There are 0 guests and 0 other users also viewing this topic