Skip to main content
1-Visitor
June 12, 2014
Solved

Loop programming

  • June 12, 2014
  • 2 replies
  • 2644 views

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?

Best answer by Werner_E

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

2 replies

1-Visitor
June 12, 2014

Can you provide a worksheet for us to work with.

25-Diamond I
June 12, 2014

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

Is automatic calculation turned on?

1-Visitor
June 12, 2014

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

12-Amethyst
June 12, 2014

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