Operators
hey guys. A little help if you don't mind.
TCOND = (CurrTopVal '>=' 1) NCOND = (Parent.WC_Backdrop.BarBack.Height == 20) HCOND = TCOND && NCOND This code crashes the ui...all variables are set and paths exist. Basically I have two things to check. I need to make sure they are both true and then do a third thing. HCOND = TCOND && NCOND Remove that line and it does not crash anymore (of course I'm screwed without it lol). Any tips or ideas? Thanks, Silat |
If you write that directly into the XML, make sure you encode it properly
HCOND = TCOND && NCONDIf that's not the issue, try encasing the operator in single quotes as well, can't hurt and usually helps. |
Tried the single quotes before I posted but it made no difference. Did not think about using the entities will try it and let you know.
Silat Edit: that was the ticket. Thanks much! |
I don't think you need single quotes on this:
TCOND = (CurrTopVal '>=' 1) Just: TCOND = (CurrTopVal >= 1) And I'd wrap parenthesis around this: HCOND = (TCOND && NCOND) |
Using XML entities is a mixed bag. I'm pretty sure you have to use & for an ampersand, but for greater than/less than, you do not use </> -- Just leave them as is, regardless of it being bad XML.
I might as well use real examples of my own code that work successfully: (I don't think I've ever used >= or <=, specifically) MATCH=MATCHNAME && MATCHTARGET FORCERESET=Parent.Progress.Bar.Progress < LastProgress |
I've usually just used the UIBuilder since it'll save them out properly, and it's less annoying to look at when editing :rolleyes:
|
I appreciate the advice guys. I never have used the ui builder. Tried it once and hated it. I edit everything in dreamweaver and then test by /loadui or relogging.
Silat |
Quote:
|
In general I do not do more than one operation per line and still had trouble using </> in the past. I don't bother with parenthesis outside of string concatenation which is the only place I'll do more than one operation in a single line. I don't like using quoted strings either as they are too much of a headache. If I need a special/reserved character, I'll put it in an XML attribute and concatenate that.
Mostly, I don't trust the parser too far. :) |
I've done multiple string comparison in my UI code in several places. You just need to do the check and the result in a different line (at least far as I remember from testing).
boolCheck=(var1 || var 2 || var3 || var 4)Like I said above, I save my code through UI builder, so it encodes the characters for me, but it definitely works. If something is crashing me, I take it line by line until I find the problem. I'll even output variables to a chat channel if I need to go as far as debugging it line by line with feedback. |
Quote:
|
All times are GMT -5. The time now is 05:55 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI