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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Programming

Heavenly
1-Newbie

Programming

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.

1 ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald II
(To:Heavenly)

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

View solution in original post

3 REPLIES 3

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.

StuartBruff
23-Emerald II
(To:Heavenly)

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

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

Top Tags