*label cafe_banter2
Are you sure? There's still stuff here to see.
*line_break
*choice
#I'm sure.
*if ((apartment_check_count1 !=0) or (apartment_check_up_count1 !=0))
*goto cafe_banter2_1
*if ((apartment_check_count1 !=0) or (apartment_check_up_count1 =0))
*goto cafe_banter2_2
#Well, on second thought...
*goto investigatecafe_a1
results in quicktest proclaiming:
QUICKTEST FAILED
Error: sub_cafegarden line 804: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.
*label cafe_banter2
Are you sure? There's still stuff here to see.
*line_break
*choice
#I'm sure.
*if ((apartment_check_count1 =0) and (apartment_check_up_count1 !=0))
*goto cafe_banter2_1
*if ((apartment_check_count1 !=0) and (apartment_check_up_count1 =0))
*goto cafe_banter2_2
*if ((apartment_check_count1 !=0) and (apartment_check_up_count1 !=0))
*goto cafe_banter2_1
*if ((apartment_check_count1 =0) and (apartment_check_up_count1 =0))
*goto cafe_banter2_3
#Well, on second thought...
*goto investigatecafe_a1
with the same result.
This is the code it comes from:
*if (apartment_checked_1 = "false") #I head back to the apartment.
*if (cafe_checked_1 = "true")
*goto cafe_banter1
*if (cafe_checked_1 = "false")
*goto cafe_banter2
*label cafe_banter2
Are you sure? There's still stuff here to see.
*choice
#I'm sure.
*if ((apartment_check_count1 !=0) or (apartment_check_up_count1 !=0))
*goto cafe_banter2_1
*else
*goto cafe_banter2_2
#Well, on second thought...
*goto investigatecafe_a1
The *else tells the autotests there are no other possible conditions…otherwise, due to the way they work, sometimes they have no way of knowing that no other possibilities exist—and then they’ll read an #option with only *if statements under it as a bug.
Hence the *else, which gives anything not under an *if (or *elseif) a place to go.
Using *else makes it a lot less painful. Spelling out every single logical option (like Carlos’ second suggestion, that you went with) is cumbersome with two variables and quickly gets impossible…
If the labels are embedded, then that is the issue, quicktest has issues with embedded labels, so to get it to pass, push the labels to the primary trunk.
Others have mentioned using *elseif, but there’s another possibility I’d suggest: the *bug statement.
It’s possible to write #options with conditionals that will always be satisfied, and still have Quicktest throw an error because it’s not evaluating those conditionals. The *bug statement serves two purposes. It satisfies Quicktest, and if you’re wrong and it is possible to get to the end of the #option test without ever hitting a *goto, Randomtest will display the text from your *bug statement and you’ll know what went wrong.
This will pass Quicktest. (I like to put the relevant variable names and values in the *bug statement so I can start my troubleshooting with “How did those variables end up with weird values?”)
*choice
#I'm sure.
*if ((apartment_check_count1 !=0) or (apartment_check_up_count1 !=0))
*goto cafe_banter2_1
*if ((apartment_check_count1 !=0) or (apartment_check_up_count1 =0))
*goto cafe_banter2_2
*bug Invalid combination of apartment_check_count and apartment_check_up_count1: ${apartment_check_count}, ${apartment_check_up_count1}
#Well, on second thought...
*goto investigatecafe_a1