Greater-than?
#1
Question 
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.
Reply
#2
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
Reply
#3
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.
Reply
#4
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.
Reply
#5
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)?
Reply
#6
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.
Reply
#7
Yeah, perfectly thanks.
Reply
#8
@spiff, how about supporting regex?

is there a function you can run it thru without a lot of code?
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#9
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
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
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.
  • Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
  • Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
  • Bedroom - LG Laptop on a 32" tv
Reply
#11
changed the name to integergreaterthan(infolabel,comparevalue)
  • Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
  • Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
  • Bedroom - LG Laptop on a 32" tv
Reply
#12
This is as of rev23198 in the svn.
  • Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
  • Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
  • Bedroom - LG Laptop on a 32" tv
Reply
#13
cheers Smile, but the current SVN is to unstable for now i will have to wait.
Reply
#14
diff should apply to old as well if you want to play with it and builds yourself.
Reply
#15
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
Reply

Logout Mark Read Team Forum Stats Members Help
Greater-than?0