If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Announcement
Collapse
No announcement yet.
How do I make a Val-con branch with more than four options?
Re: How do I make a Val-con branch with more than four options?
It may have to do with the order in which you present the valid values. I think it goes straight down the list to see which branch to take, going with the first one that fits the value.
Re: How do I make a Val-con branch with more than four options?
Have you tired changing the mode on the fourth one and making another one with for. It may still only be four but it will act as if it were more. I think
However I thought that the other val condition branch in the val condition branch would work so it may not.
Re: How do I make a Val-con branch with more than four options?
Let me guess..
It works fine for 0-3, but nothing happens when the variable's value is 4-9.
You can do one of two things:
1) You can change the requirement for branch 4 to >= 3 (Greater than or equal to 3), rather than = 3. Do the same with branch 4 of the second set of branches.
2) You can remove the val-conditional branch set from branch four and make it a separate val-conditional branch immediately after the first one ends, and do the same with the third set of branches, effectively making it three completely separate sets of branches.
Either way, it's fundamentally the same code.
Option 2 is cleaner and takes fewer lines (26 lines as opposed to 30), but will require more effort to implement.
Basically, the system is assuming that there is nothing to do if the value of the variable is not 0, 1, 2, or 3. The change in option 1 tells the system to do actions for 0, 1, 2, 3, and any value greater than 3.
Option 2 tells the system that if the value isn't 0-3, it should move on to the next command down the list, which is the next branch set. If the value isn't 4-7, then it moves on to the 2-way branch for 8-9. Any time that a variable is not within the range of values valid for a val-conditional branch, the entire branch code is ignored, and the system moves on to the next thing on the list.
"Embedding" branches (What you're doing if you take option 1) makes the second branch part of the code for the initial branch, so even if the value is valid for the second branch, it will also be ignored by the system.
Comment