Skip to main content
1-Visitor
May 4, 2012
Solved

Programming

  • May 4, 2012
  • 2 replies
  • 2220 views

On pages 22 and 23, Section 14.1 of this file are calculations for 7 different cases. Each case has a boolean expression to satisfy. I need to create some kind of loop that will start with the expression for case 1 and if that is satisfied return case = case 1. If case 1 doesnt satisfy the expression i need to look at case 2 and if that works return case = case 2 an dif not continue to case 3. I need the loop to follow this logic to find the first expression that is satisfied and return that case or go until it reaches case 7. Any help would be appreciated. Thanks.

Best answer by StuartBruff

David DePolo wrote:

On pages 22 and 23, Section 14.1 of this file are calculations for 7 different cases. Each case has a boolean expression to satisfy. I need to create some kind of loop that will start with the expression for case 1 and if that is satisfied return case = case 1. If case 1 doesnt satisfy the expression i need to look at case 2 and if that works return case = case 2 an dif not continue to case 3. I need the loop to follow this logic to find the first expression that is satisfied and return that case or go until it reaches case 7. Any help would be appreciated. Thanks.

Many ways of skinning this particular cat.

On the assumption that you wish to retain the look and style of the section, see attached. There are a few other alternative approaches given as well.

Stuart

2 replies

12-Amethyst
May 4, 2012

Sounds like a good use of the "while" loop in a program. Do the case calculations in the loop until your criterion is satisfied. Update the case number in the loop, and then the final case number will be sent to the output variables.

23-Emerald V
May 4, 2012

David DePolo wrote:

On pages 22 and 23, Section 14.1 of this file are calculations for 7 different cases. Each case has a boolean expression to satisfy. I need to create some kind of loop that will start with the expression for case 1 and if that is satisfied return case = case 1. If case 1 doesnt satisfy the expression i need to look at case 2 and if that works return case = case 2 an dif not continue to case 3. I need the loop to follow this logic to find the first expression that is satisfied and return that case or go until it reaches case 7. Any help would be appreciated. Thanks.

Many ways of skinning this particular cat.

On the assumption that you wish to retain the look and style of the section, see attached. There are a few other alternative approaches given as well.

Stuart

Heavenly1-VisitorAuthor
1-Visitor
May 7, 2012

Stuart thank you very much for the examples. I chose to use the last vector solution which really simplified the calculations. Thanks again for such a quick detailed response.

Dave