Can't get X and Y statement to work #774
Answered
by
joningold
LilCelestial
asked this question in
Writing in ink
Replies: 2 comments 2 replies
-
Your ANDs are fine, but if you’re testing equals you need to use == not =.
A = B means “set A to the value of B” and can’t be used inside a condition
A == B means “compare A and B” and can’t be used outside of a condition
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
LilCelestial
-
You can use an AND in that way. The problem was the use of a single equals
not a double equals.
Try copying this into inky:
~temp z= 1 // a single equals. This sets the value of z
{z==1} // this will say true; it’s comparing z and 1
{z==1 and z < 5} // this will say true
{z==2} // this will say false. It doesn’t set the value of z
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm desperate for help. I'm using inky for the first time. I've been trying for hours to get X and Y statements to work using variables I've set and I've had no luck. Can anyone see what I'm doing wrong?
This is what they look like:
{number_of_advice=3 and hasdate=1:->ConcludeDatePrep}
{(number_of_advice=3)&&(hasdate=1):->ConcludeDatePrep}
{ (number_of_advice=3) && (hasdate=1)}->ConcludeDatePrep
I've tried all the variations I can think of, > 2 instead of =3, the hasdate variable as true/false instead of numerical. My variables are set at the beginning of my file.
VAR number_of_advice = 0
VAR hasdate = 0
Any help would be hugely, massively, greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions