I have often wonder if XBMC would ever implement conditional statements. If a condition is met, return something, else return something else
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:
So, the control above will be visible only if the year value is not empty since I don't want the ui to show " | Movie Title" if the year is missing; thus, now i need to create another label control to display only if the year value is missing...
<label>$INFO[ListItem.Year] | $INFO[ListItem.Title]</label>
By having the ability to use and IIF statement, we can then "simplify" the code like so:
Now then... the code above will check if the year value is missing, if it is, it will return just the title otherwise it will return the the year, separator and the title, plus we have eliminated the visible tag thereby shortening the code and the need to create additional controls.
<label>IIF(IsMissing($INFO[ListItem.Year]),$INFO[ListItem.Title,$INFO[ListItem.Year] | $INFO[ListItem.Title])</label>
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...