If I’m using a word (string) for a variable, I’m supposed to put it in quotes, right? e.g.:
VAR current = "spy"
But if I have that same word defined as part of a list:
LIST completed = spy, heist, noir, truth
Then it seems to let me get away with NOT having my variable be in quotes—I think because now it isn’t viewing it as a string but as a value in the list?
The starting state for my ‘current’ variable is NOT defined in a list, and so it MUST be in quotation marks. But when events happen to change that variable, it lets me use either
~ current = "spy"
or
~ current = spy
Today, seemingly out of nowhere, it started giving me error after error that basically want me to add quotation marks from my variables anytime I test against them. This happened to me once before, but in the opposite direction (removing quotation marks around variable string names) and I’ve already gone through all my code once changing “spy” to spy (no quotation marks) because of this “Can not use ‘==’ operation on String and List” error.
I thought it was all fixed (that was like a month ago, probably more, and it’s been fine) but now it’s happening again but wanting me to add the quotation marks back in. Here’s an example of the offending code:
{
- current == spy && not inquire_at_each_bank:
<- inquire_at_each_bank
- current == heist:
<- go_peoples_bank
...
If I make them be == "spy"
and == "heist"
the error clears.
Where I give the “current” variable its new value, those are all in quotation marks: current = "spy"
. current = "heist"
, current = "noir"
etc. I think I did that as a part of the last time I had to change everything? But, if I take the quotation marks off there, it clears the scads of errors that suddenly appeared.
Can anyone explain what is happening? Does it matter whether the variable state is a string or is using the value of a list item? Should I not be using the same names for the variable states as I do in the list? (Also, I don’t understand why it was fine and not it wants it back the other way, though that’s of less importance I guess)
I really don’t care one way or another, I just don’t want to continuously be going through all my ink code changing it back and forth! :S