I have often wonder if XBMC would ever implement conditional statements. If a condition is met, return something, else return something else
PHP Code:
IIF(ConditionTest,True,False)
I find it a bit cumbersome to create multiple controls to display/obtain the same info just formatted diffently.
For example, a concatinated string that may be a bit different depending on the content or lackthereof. Suppose that I want to display the year, the title... i would use and have seen the following:
PHP Code:
<control type="label">
<label>$INFO[ListItem.Year] | $INFO[ListItem.Title]</label>
<visible>!IsEmpty($INFO[ListItem.Year])</visible>
</control>
By having the ability to use and IIF statement, we can then "simplify" the code like so:
PHP Code:
<control type="label">
<label>IIF(IsMissing($INFO[ListItem.Year]),$INFO[ListItem.Title,$INFO[ListItem.Year] | $INFO[ListItem.Title])</label>
</control>
This could possible be used with textures as well... Yes, it can become a bit of a pain in the, well..., if there are any nested IIF statements; additionally, I'm not sure if xbmc would take a performance hit with such structure.
Anyway, I apologize if this sounds confusing; I was curious, that's all...

![[Image: sig_zps3af3b48e.jpg]](http://i620.photobucket.com/albums/tt289/Arcanthur/Celestium/sig_zps3af3b48e.jpg)
![[Image: xp1080-21.png]](http://www.planet-ira.de/wallpaper/xp1080-21.png)
![[Image: badge.gif]](http://www.ohloh.net/projects/9132/badge.gif)

Search
Help