EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > UI Developer Discussion

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 08-14-2011, 04:32 PM
kdmorse kdmorse is offline
A Young Mystail Rat
 
Join Date: Jan 2005
Server: Antonia Bayle
Posts: 7
Default Short Circuit Booleans?

I'm sure the answer is no, but I thought I'd ask.

Does the UI language perform short circuit boolean evaluations? Or does it fully evaluate all expressions even when unnecessary?

ie, if one were to code something like:

Result=( X || Text==Parent.Parent.Something )

Would the text compare be performed even if X is already set to True? (Making the text comparison unnecessary?) Or would it do the text compare anyway?
Reply With Quote
  #2  
Unread 08-14-2011, 05:02 PM
kdmorse kdmorse is offline
A Young Mystail Rat
 
Join Date: Jan 2005
Server: Antonia Bayle
Posts: 7
Default

And while I'm at it, do we have an XOR operator, or a logical Not?

So far, my attempts at anything like Test=( !X ) have not worked. I had to resort to Test=X ? false : true.
Reply With Quote
  #3  
Unread 08-14-2011, 07:08 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

I don't think anyone outside of SoE could tell you that unless they benchmarked a huge number of iterations of such. Though I sort of wonder why you care.

Secondly, I couldn't tell you if it's the case for your example, but often the UI evaluates things right to left, but your assumption in your example assumes it checks the left side of the || first instead.

Thirdly, there are situations where you can and cannot have several evaluations on a single line. If you can get a multi-boolean evaluation to work there, good for you... but I never try to make it do complicated things because they just cause debugging headaches when it decides not to work.

There's some sort of operator thread stickied someplace... if you haven't found it in there, it probably doesn't exist. Trying to use random ones from other languages is probably futile. The UI scripting language isn't really based on any standard as much as it borrows random things.
Reply With Quote
  #4  
Unread 08-14-2011, 07:37 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 kdmorse View Post
And while I'm at it, do we have an XOR operator, or a logical Not?

So far, my attempts at anything like Test=( !X ) have not worked. I had to resort to Test=X ? false : true.
The operator, as in other programming languages, is !=. In XML write it as '!'=.

As to your first question, the answer is no, but that's because you have to pre-evaluate your expressions anyway, the example code you posted will not 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.

Last edited by gm9 : 08-14-2011 at 07:41 PM.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:29 PM.


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