Skip to main content
1-Visitor
Jun 12, 2014 2:08 PM UTC
Solved

Loop programming

I'm trying to right a small programming loop to increase the size of a dimension until it passes a certain safety check. Here's what I wrote:question.jpg

All of the OTM values are defined before the function as well as the values for "Code", W.f, FS.OTM, D, a, W.T, D.f, R.p.x, A.p. However, this never produces a value for W.f.new. Can anyone point out where I'm going wrong with this?

Werner_E
Werner_EAnswer
25-Diamond I
Jun 12, 2014 3:24 PM UTC

I overlooked on first inspection that you have created an endless loop.

You have to ensure that the values of the RM's and FSOTMy change, when you change W. This can either be done by putting the calculation of those values in the while loop as in the attached or by turning those calculations into functions of W.

12.06.png

7 replies

1-Visitor
Jun 12, 2014 2:21 PM UTC

Can you provide a worksheet for us to work with.

Translate
Werner_E
25-Diamond I
Jun 12, 2014 2:33 PM UTC

What happens if you place the cursor in the expression which yields no result and prerss F9?

Is automatic calculation turned on?

Translate
1-Visitor
Jun 12, 2014 2:50 PM UTC

Automatic calculation is turned on. The programming loop just runs indefinitely, though.

Translate
12-Amethyst
Jun 12, 2014 3:04 PM UTC

Capture.PNG

While loop increments the value of W but there is no change to values of FS.xxx

So it does not exit.

What should be modified by the change in W?

Regards

Andy

Translate