Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed May 19, 2011 at 02:25 PM by biohazard for the following reason:

Solved

avatar image
0
Question by biohazard · May 19, 2011 at 02:09 PM · javascriptfor-loop

[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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
1

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.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image biohazard · May 19, 2011 at 02:16 PM 0
Share

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 :)

avatar image biohazard · May 19, 2011 at 02:23 PM 0
Share

it indeed ends. I added a print telling me the current line number and shortened the read interval. it's working :)

avatar image jahroy · May 19, 2011 at 02:24 PM 2
Share

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

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges