|
Shezmu Wanderer
Joined: 23 Apr 2010 Posts: 53
|
Posted: Mon Sep 06, 2010 6:36 pm
#IF expression having more than one condition |
This may be a simple one, but I couldn't find the answer in a previous post.
I have a simple trigger that populates the long name of a mob to the variable "lstarget". The long name may be something like "a lumbering turtle" or "the robber thief", etc. I want to strip the "A, a, an, the..." article.
Is there any way to do the following and get it to work right?
#IF (%word(@lstarget,1)="A|an|the") {etc..}
Or do I have to do this:
#IF ((%word(@lstarget,1)="A") || (%word(@lstarget,1)="an") || (%word(@lstarget,1)="the")) {etc...} |
|
|
|
robecks Beginner
Joined: 22 Jun 2010 Posts: 17
|
Posted: Mon Sep 06, 2010 7:49 pm |
#IF (%word(@lstarget,1)="{A|an|the}") {etc..}
should work iirc |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Sep 06, 2010 9:40 pm |
#if (%ismember(%word(@IsTarget,1),"A|an|the")) {...}
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Shezmu Wanderer
Joined: 23 Apr 2010 Posts: 53
|
Posted: Mon Sep 06, 2010 10:28 pm |
Thanks Matt. Worked perfectly. I don't know why I didn't think of ismember.
|
|
|
|
|
|