|
03-09-2011, 09:24 PM
|
A Griffon
|
|
Join Date: Nov 2005
Server: Nagafen
Posts: 1,096
|
|
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
|
03-09-2011, 09:58 PM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
If you write that directly into the XML, make sure you encode it properly
HCOND = TCOND && NCOND If that's not the issue, try encasing the operator in single quotes as well, can't hurt and usually helps.
|
03-09-2011, 10:13 PM
|
A Griffon
|
|
Join Date: Nov 2005
Server: Nagafen
Posts: 1,096
|
|
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!
Last edited by TalTal : 03-09-2011 at 10:15 PM.
|
03-10-2011, 12:13 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
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)
|
03-11-2011, 04:55 PM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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
Last edited by EQAditu : 03-11-2011 at 04:59 PM.
|
03-11-2011, 05:00 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
I've usually just used the UIBuilder since it'll save them out properly, and it's less annoying to look at when editing
|
03-11-2011, 05:34 PM
|
A Griffon
|
|
Join Date: Nov 2005
Server: Nagafen
Posts: 1,096
|
|
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
|
03-11-2011, 09:33 PM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
Quote:
Originally Posted by EQAditu
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.
|
IIRC the entities for <> work fine in formulas, however the parse chokes when you start chaining expressions containing them like we are doing here since at one point it stops interpreting them before trying to resolve the expression. But a simple (1 < 2) ? 'true' : 'false' should work.
|
03-14-2011, 08:22 AM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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.
|
03-14-2011, 08:34 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
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)
boolResult=(boolCheck ? true : false) 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.
|
03-14-2011, 11:34 AM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
Quote:
Originally Posted by Drumstix42
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)
boolResult=(boolCheck ? true : false)
|
You can do as many similar operations as you want, the above should even work in single line, but as soon as you mix operators you're out of luck. used to be like that anyway.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:44 PM.
|
|