Page 1 of 1

Help with /if syntax

Posted: Sun May 09, 2004 12:41 am
by invis
Hiya Folks --

Tryin to write a simple merchant checking macro, and having issues with numeric comparisons.

to test the comparison, I'm using the folowing line, after clicking on a Feather in an open merchant window.

Code: Select all

/if (${SelectedItem.ID}==${Merchant.Item[=Feather].ID}) { /echo Yes }
This returns nothing. However, if I change the /if to /echo like:

Code: Select all

/echo (${SelectedItem.ID}==${Merchant.Item[=Feather].ID}) { /echo Yes }
I get

Code: Select all

(13094==13094) {//echo Yes}


in the MQ window, which is what I'd expect to see. So, theoretically, the two IDs are equivalent. Both types come down to ints, according to the posts, if I'm reading it right.

Can anyone shed some light on why a numeric comparison isn't working?

Thanks!

Posted: Sun May 09, 2004 12:45 am
by ml2517
Your problem is that you can't have your opening curly brace and closing one on the same line, do it like this:

Code: Select all

/if (${SelectedItem.ID}==${Merchant.Item[=Feather].ID}) {
    /echo Yes 
}

Or like this

/if (${SelectedItem.ID}==${Merchant.Item[=Feather].ID}) /echo Yes

Posted: Sun May 09, 2004 12:47 am
by invis
Well, thanks for settling n00b issue #1 so quickly :oops: