cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

While loop - infinite calculation - reason?

dcompel
1-Visitor

While loop - infinite calculation - reason?

Hello,

My name is Daniel and I would like to kindly ask you for help with while loop. The problem is that i cant calculate this loop because it looks like it never ends. Any ideas why? Can somebody look at it for me please? Here's my code:

Loop.png

And here is how it should work step by step

Loop_EXPLANATION.png

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:dcompel)

Its hard to debug a picture!

Please post the worksheet.

You can do so by clicking "Use advanced editor" at the upper right. Then you get at the lower right an option to attach files.

WE

EDIT:

Maybe its simpler than I thought.

You use variables "sigma.com.ed.1" AND "sigma.com.ed1" in your program. Guess both should be the same variable and the dot before the 1 is a typo.

Anyway, "sigma.com.ed" and "sigma.com.ed.1" are use as condition in the while loop but both never change - that explains the endless loop.

View solution in original post

2 REPLIES 2
Werner_E
25-Diamond I
(To:dcompel)

Its hard to debug a picture!

Please post the worksheet.

You can do so by clicking "Use advanced editor" at the upper right. Then you get at the lower right an option to attach files.

WE

EDIT:

Maybe its simpler than I thought.

You use variables "sigma.com.ed.1" AND "sigma.com.ed1" in your program. Guess both should be the same variable and the dot before the 1 is a typo.

Anyway, "sigma.com.ed" and "sigma.com.ed.1" are use as condition in the while loop but both never change - that explains the endless loop.

Oooh my GOD , you are right! thank you very much. saved my day. this is just stupid... Im just laughing right now its every time thing like that. btw I forgot to upload the file but it doesn't matter anymore.

Heres the working code (there was also mistake in condition)

Loop_WORKING.png

Announcements

Top Tags