- Home /
Solved
[SOLVED]Does this loop actually end?
I fear that i might have an endless loop problem here :/
function lese_datei() // Öffnen und Parsen der Datei.
{
Zeilen = CSVDatei.text.Split("\n"[0]); // Parsen an Zeilenendekennung
for(i=4;i < Zeilen.length; i++)
{
Werte = Zeilen[i].Split(";"[0]); // Parsen am Semikolon
var Geschwindigkeit_pos = int.Parse(Werte[4]);
var Umdrehungen_pos = int.Parse(Werte[8]);
var Motorhitze_pos = int.Parse(Werte[9]);
Geschwindigkeit_rotation = (Geschwindigkeit_pos / 300.0) * 180.0;
Umdrehungen_rotation = (Umdrehungen_pos / 8000.0) * 240.0;
Motorhitze_rotation = Motorhitze_pos;
print("Geschwindigkeit:"+Geschwindigkeit_pos+"\n"+"RPM:"+Umdrehungen_pos+"\n"+"Temperatur:"+Motorhitze_pos+"\n\n\n"+"Gradzahl speed:"+Geschwindigkeit_rotation+"\n"+"Gradzahl rpm:"+Umdrehungen_rotation+"\n"+"Gradzahl Temperatur:"+ Motorhitze_rotation);
yield WaitForSeconds(1.0);
}
}
function Start()
{
lese_datei();
}
any thoughts? will this loop end?
Answer by GesterX · May 19, 2011 at 02:12 PM
It looks like it will end. You could put a print statement at the end of the function to find this out.
Well i will NOT restart this reading process, since right now there's a file being read which has 1600+ lines... but thank you for the answer :)
it indeed ends. I added a print telling me the current line number and shortened the read interval. it's working :)
If you have a 1,600 line file it looks like you should be waiting an absolute $$anonymous$$imum of 26 $$anonymous$$utes for your script to run, given the fact that you're waiting for 1 second each iteration.
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Setting Scroll View Width GUILayout 1 Answer
What's wrong with this Loop? 2 Answers
Limit on GUI Components? 0 Answers
I need help with a script(brauche hilfe mit einen Script) 0 Answers