ListContains won't work

I have

player.somelist=newStringList()
list add (player.somelist, somestring)

And then

{if ListContains(player.somelist, somestring):sometext)

But there is nothing displayed.
Same thing with "in" or objectlist.


Some of your syntax was wrong. It should be:

player.somelist = NewStringList()
list add (player.somelist, "somestring")
if (ListContains (player.somelist, "somestring")) {
  msg ("sometext")
}

I can't do this with text processing ?


The "if" function in the text processor does odd things which can cause some functions not to work.

Change {if to {either (which treats its condition as a normal Quest expression) and it should work fine.


Ok thanks.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums