Timeline for Is it always possible to separate multiple conditions in an IF statement into individual statements?
Current License: CC BY-SA 3.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 12, 2017 at 7:31 | history | edited | CommunityBot |
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
|
|
| Nov 11, 2015 at 15:39 | history | tweeted | twitter.com/StackProgrammer/status/664467423005974528 | ||
| Oct 28, 2015 at 17:34 | review | Close votes | |||
| Nov 4, 2015 at 11:45 | |||||
| Oct 28, 2015 at 17:25 | comment | added | leylandski | Edited to explain difference. | |
| Oct 28, 2015 at 17:24 | history | edited | leylandski | CC BY-SA 3.0 |
explained why not a duplicate
|
| Oct 28, 2015 at 17:18 | comment | added | gnat | Possible duplicate of How should I test boolean function with many possible permutations | |
| Oct 28, 2015 at 17:01 | answer | added | amon | timeline score: 6 | |
| Oct 28, 2015 at 16:50 | comment | added | leylandski | Not sure what you mean when you say to create a new value. I've added clarification but each business rule (stealing terminology from MS Dynamics) can have as many IF statements as the user defines, and they can be executed sequentially or can be nested. | |
| Oct 28, 2015 at 16:48 | history | edited | leylandski | CC BY-SA 3.0 |
clarification
|
| Oct 28, 2015 at 16:44 | comment | added | ratchet freak | Can you create a new value to test with the next line? | |
| Oct 28, 2015 at 16:38 | comment | added | leylandski |
I have a similar solution for validation rules with a conditional logic parser/evaluator ((1 OR 2) AND 3) but I was hoping I wouldn't have to revisit that code for a while :/
|
|
| Oct 28, 2015 at 16:36 | comment | added | amon |
@leylandski Many rule engines allow a if/then rule to have multiple conditionals that can be combined: if all of … and … and … then … or if any of … or … or … then …. This is fairly simple to understand since the complexity of a rule condition is limited – the language need not be recursive. Note that nesting conditionals is equivalent to and, but multiple separate conditionals with the same body would be equivalent to or. That becomes really unwieldy very fast, so I'd recommend against this wrong kind of minimalism.
|
|
| Oct 28, 2015 at 16:11 | comment | added | leylandski |
Not quite, I need if (a) and (b) to become if (a) then... if (b) then.... It's long winded and inefficient but in this case it means the user doesn't have to understand the syntax of the statement, they can just pick values. What I want to know though is can this principle be employed for all conditional logic or is there a case that cannot be done like this?
|
|
| Oct 28, 2015 at 16:07 | comment | added | user22815 |
You need (select value) to be ((select value 1) AND (select value 2))?
|
|
| Oct 28, 2015 at 15:57 | history | asked | leylandski | CC BY-SA 3.0 |