SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-30-2010, 07:43 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Troubles with If...

Hello,

I've been trying to use the Utility If call to determine if an object is a MediaObject or not. The java docs quite clearly states that:

Returns the second argument if the first argument is true, otherwise the third argument is returned. All 3 arguments will be evaluated in all cases. This does NOT have a short-circuit which prevents evaluation of the third argument if the first is true.

Is there an equivalent call that will provide a short-circuit so it doesn't evaluate the third argument if the first is true?

Cheers

Ben

Edit:

Never mind we got around it another way.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders

Last edited by jaminben; 01-30-2010 at 10:01 AM.
Reply With Quote
  #2  
Old 01-30-2010, 12:27 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by jaminben View Post
Is there an equivalent call that will provide a short-circuit so it doesn't evaluate the third argument if the first is true?
By definition, a method call always evaluates all of its arguments, before the method itself is invoked. So no, there's no way to write an If() method that doesn't do that; it's a fundamental part of the language, not a quirk of that particular method. The only way to avoid evaluation is to use the Conditional widget control stucture to skip over whole lines of code.
__________________
-- Greg
Reply With Quote
  #3  
Old 01-30-2010, 02:14 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Ahhh, thanks for the explanation......I did wonder but now I know for sure

Cheers

Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
tuning troubles jsschrstrcks SageTV Software 9 02-26-2009 10:27 PM
HDHomerun troubles pvr599 Hardware Support 7 09-13-2007 02:58 PM
FF/REW Troubles with HD scoful SageTV Software 6 03-03-2007 08:19 PM
Placeshifter Troubles crazymateo SageTV Linux 1 12-15-2006 10:42 PM
Troubles with FSE Sten3danny SageTV Software 4 12-03-2005 02:51 PM


All times are GMT -6. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.