Kodi Community Forum

Full Version: Greater-than?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all you gurus,

is there anyway i can set visibility on a grater-than NumItems.

i was trying this:
Code:
<visible>stringcompare(NumItems,>4)</visible>

but it does not work.

any ideas ?

Andy.
uhm, that's a stringcompare!

currently, the only way to do it would be

<visible>[!stringcompare(NumItems,4) + !stringcompare(NumItems,3) + !stringcompare(NumItems,2) + !stringcompare(NumItems,1) + !stringcompare(NumItems,0)]</visible>

or thereabout
spiff Wrote:uhm, that's a stringcompare!

currently, the only way to do it would be

<visible>[!stringcompare(NumItems,4) + !stringcompare(NumItems,3) + !stringcompare(NumItems,2) + !stringcompare(NumItems,1) + !stringcompare(NumItems,0)]</visible>

or thereabout

OK got yeah, i try.


thanks for that.

Andy.
yup, it worked, but i need a "|" (or) and not a "+" (and)


but thanks anyway, i was on the right track just needed the correct syntax.


Andy.
Could this be used to determine whether to use a fixedlist (when the number of items is less than or equal to the items on screen) or a wraplist (when the number of items is greater than the number of items on screen)?
Hitcher Wrote:Could this be used to determine whether to use a fixedlist (when the number of items is less than or equal to the items on screen) or a wraplist (when the number of items is greater than the number of items on screen)?

you could but it would not be practical, you would need to list ALL the items above the max number you could fit in a fixedlist, so if you have can fit 10 in your list and you have 100 items to scroll through, you would do a visible for 10 for the fixed list and a visible for the 90 remaining.

you could not even use != to the first 10, because they exist the that list as well

because < & > don't exist only = or !=

hope i have made sense.
Yeah, perfectly thanks.
@spiff, how about supporting regex?

is there a function you can run it thru without a lot of code?
IMO We don't want to run a regex on a string every single frame.

Until we have pushed info setup, anything much more than we already have is slowing things down too much.

Assuming Container.NumItems is available, then surely you can determine whether there is 10 or fewer items on screen using "just" 11 compares? Note that general string compares aren't good for comparing numbers (though we do have a alphanumeric compare which could be used instead).

Cheers,
Jonathan
I've made a patch that adds the visibility condition stringgreaterthan(infolabel,comparevalue).

http://trac.xbmc.org/ticket/7007

Feel free to review it. Smile

I didn't make a stringsmallerthan since you just can use the !stringgreeaterthan(...,...) instead.
changed the name to integergreaterthan(infolabel,comparevalue)
This is as of rev23198 in the svn.
cheers Smile, but the current SVN is to unstable for now i will have to wait.
diff should apply to old as well if you want to play with it and builds yourself.
spiff Wrote:diff should apply to old as well if you want to play with it and builds yourself.

i would but i'm now on osx 10.6 so cant build my own anymore Sad