Write condition to check if a variable equals another SOLVED

I would like to add a condition that checks if a variable (v1) equals the same as another (v2), or if easier, if a text string of one box equals a different box? :smiley:

Just use the condition to check a variable text:

Text of variable V1 is = "some text"

But instead checking it against a fixed string (e.g. “some text”), do it against the other variable:

Text of variable V1 is = VariableString(V2)

The function VariableString(V2) return the string stored in V2

There is a condition to compare two numbers in “All conditions >> Other >> Compare two expressions”, but there is no equivalent for strings, so you have to save one of the strings in a variable to use the variable conditions as above :slight_smile:

So (attached photo) here is a couple of my generators, which each produce a non-repeating variable within the range 1-14 and then put the number into a text box (Word2 or Word3).

So either of those suggestions above I guess would would. Would it just be easier to use the ‘compare two expressions’? in which case what is the expression? is it the “VariableString(random2)” and “VariableString(random3)”?

What would you use?

This probably helps LOL

The only option is trough variables conditions ( Text of variable V1 is = VariableString(V2) ), because “Compare two expressions” works with numbers only, not with strings :wink:

Wait, do you want to compare the strings stored in the text boxes (Word2 and Word3)? They are text objects (sorry, I didn’t understand the “box” part), so you can use the text objects condition to check the current string, it’s at “All conditions >> Text object >> Compare the text”, the condition should be:

Text of Word2 is = Word3.String()

Word3.String() return the string stored in Word3, this function works for text objects only.

Awesome thanks :slight_smile: