Changes between Initial Version and Version 1 of Ticket #2309, comment 9


Ignore:
Timestamp:
2013-08-13T20:40:52Z (11 years ago)
Author:
Lennart Ochel

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2309, comment 9

    initial v1  
    22
    33As to a while-loop, is there a reason to prefer it over a for-loop if we knew that the number of lines in the file is fixed?---But, actually, we are approaching my original intent: i wanted to read in items from a file whose number is not fixed. So i need a while-loop. Therefore i checked a modification of the model above which just replaces the for-loop by a while-loop (and introduces an explicit variable for indexing the lines):
    4 
     4{{{#!mo
    55model ReadArray
    66  import Streams = Modelica.Utilities.Streams;
     
    2222  end while;
    2323end ReadArray;
    24 
     24}}}
    2525The translation seems to be ok, but, unfortunately, now the executable crashes.
    2626The second thing i need is an array with an unspecified dimension. I checked it with a model that leaves just the dimension unspecified (and still uses a for-loop):
    27 
     27{{{#!mo
    2828model ReadArray
    2929  import Streams = Modelica.Utilities.Streams;
     
    4343  end for;
    4444end ReadArray;
    45 
     45}}}
    4646Here i get:
    4747