Forum Rules Notice

Due to inappropriate SPAM postings, our forums are now being monitored for inappropriate content. This will cause your post to not appear publicly until it has been approved by a forum moderator. We apologize for the delay this may cause in your response, but have found it the best way to control inappropriate posts.


  Reply to this topicStart new topicStart Poll

> Multiple If Statements
TeKo
Posted: Mar 12 2009, 05:42 AM




Is there another function algorithm other than using multiple if statements.

For Example,

control: range(1,6)
If control=1, so...soo..
If control=2, so...soo..
If control=3, so...soo..
If control=4, so...soo..
If control=5, so...soo..
If control=6, so...soo..

Thanks,
Steve
PMEmail Poster
Top
p_e_barnes
Posted: Mar 13 2009, 01:05 PM




Nesting the IF-statements will combine all of the statement into one since the FALSE value results in an IF-statement. Be sure to balance your parentheses.

IF (control = 1, so 1, IF (control = 2 , so 2, IF (control = 3, so 3, IF (control = 4, so 4, IF (control = 5, so 5, IF (control = 6, so 6 )))))).

PMUsers Website
Top
TeKo
Posted: Mar 23 2009, 10:04 PM




Thanks Barnes,

But that's what I currently do and want to avoid. Is there another way?

Thanks,
Steve
PMEmail Poster
Top
jtreagan
Posted: Nov 19 2009, 02:46 PM




I've run into the same problem. Nested IF statements is incredibly clumsy. Is there a way to do a For-Next loop or something similar?
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Reply to this topic Start new topicStart Poll

 


Copyright 1998-2008 eInstruction Corp. All rights reserved.