*if blocks seemingly not behaving correctly

Currently, I have 3 *if blocks, with each having a *goto:

*if (t_genuine_handshake) =true
	*goto t_genuine_handshake
*elseif (t_stoic_handshake) =true
	*goto t_stoic_handshake
*elseif (t_sarcastic_handshake) =true
	*goto t_sarcastic_handshake

The variables are set up earlier, with each choice having a different one. However, no-matter which choice I pick, they all trigger the

*if (t_genuine_handshake) =true

block, and I am unsure on what exactly is happening. With that being said, would someone be able to please take a second look?

Anyway, I hope that all who read this have a good rest of their day.

Try there…

*if t_genuine_handshake = true
	*goto t_genuine_handshake
*elseif t_stoic_handshake = true
	*goto t_stoic_handshake
*elseif t_sarcastic_handshake = true
	*goto t_sarcastic_handshake

I also recommend leaving the last one as *else in case none of the others triggers the *if you won’t get an error this way.

*if t_genuine_handshake = true
	*goto t_genuine_handshake
*elseif t_stoic_handshake = true
	*goto t_stoic_handshake
*else
	*goto t_sarcastic_handshake
1 Like

or (your choice):
*if (t_genuine_handshake = true)

If you want to evaluate something before the comparison then you need extra parentheses:

*if ((x + y) = 2)

Can you show us the choice code? The bit where the choices are and you set the handshake variables

1 Like

You don’t need the = true part at all. As long as the variables are initialized to boolean (true/false) values, it should evaluate correctly. To figure out why it’s not working, print the values of the variables to the screen, while you’re testing. One of them probably got set incorrectly.

Like this:

lorem ipsum blah blah

t_genuine_handshake: ${t_genuine_handshake}

*if (t_genuine_handshake)
    conditional text

…etc.

Yes, although I think I figured out what was happening, with that being that I set the variables that the *if’s are triggering as false. Just went back over the choices to check some other things, found where I set 2 out of the three, said being t_stoic_handshake and t_sarcastic_handshake, had a little giggle, then fixed them.
After that, it seems to be working now.

It’s always the smallest things, isn’t?
Anyway, thank you all for your assistance, smiley.

1 Like