EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 03-09-2011, 09:24 PM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,095
Default 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
Reply With Quote
  #2  
Unread 03-09-2011, 09:58 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

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.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #3  
Unread 03-09-2011, 10:13 PM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,095
Default

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.
Reply With Quote
  #4  
Unread 03-10-2011, 12:13 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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)
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #5  
Unread 03-11-2011, 04:55 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

Using XML entities is a mixed bag. I'm pretty sure you have to use &amp; for an ampersand, but for greater than/less than, you do not use &lt;/&gt; -- 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 &amp;&amp; MATCHTARGET
FORCERESET=Parent.Progress.Bar.Progress < LastProgress

Last edited by EQAditu : 03-11-2011 at 04:59 PM.
Reply With Quote
  #6  
Unread 03-11-2011, 05:00 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I've usually just used the UIBuilder since it'll save them out properly, and it's less annoying to look at when editing
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #7  
Unread 03-11-2011, 05:34 PM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,095
Default

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
Reply With Quote
  #8  
Unread 03-11-2011, 09:33 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by EQAditu View Post
Using XML entities is a mixed bag. I'm pretty sure you have to use &amp; for an ampersand, but for greater than/less than, you do not use &lt;/&gt; -- 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 &lt; 2) ? 'true' : 'false' should work.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #9  
Unread 03-14-2011, 08:22 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

In general I do not do more than one operation per line and still had trouble using &lt;/&gt; 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.
Reply With Quote
  #10  
Unread 03-14-2011, 08:34 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #11  
Unread 03-14-2011, 11:34 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by Drumstix42 View Post
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.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:54 AM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI