A strcmp (stringcompare) type function
#16
Make sure you don't have any trailing or leading spaces on the "bar":
Do not:
substring(foobar, bar,Right)
substring(foobar,bar ,Right)
substring(foobar, bar ,Right)

Do
substring(foobar,bar,Right)

(this had me puzzled a couple of minutes on stringcompare())
  • 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
#17
watzen, your wiki entry does not mention the fact that you can do

substring(foobar,oo) and it will match. that is the possibility to not specify left or right (which means it will match anywhere in the string)
Reply
#18
I'm 100% sure I added that last night.

edit: And I did...

(cur) (last) 00:07, 5 January 2009 Watzen (Talk | contribs) (14,483 bytes)
substring(info,string) Returns true if the string is found anywhere in the info

substring(info,string,[Left or Right]) Returns true if the string is found from the start or the end.
Example:

(foobars,foob,Left) -> true
(foobars,foob,Right) -> False
(foobars,bars,Right) -> true
  • 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
#19
ah you put it as a separate entry. sorry bout that
Reply
#20
hmm, with this you could do a pseudo hd-flagging on the selected item with
<visible>substring(listitem.filename,720p) | substring(listitem.filename,1080p) | substring(listitem.filename,1080i)</visible>

But I like CapnBry's way better, but if you want to have HD-flagging before it makes it to the main branch you could do it this way.
  • 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
#21
Okay, here's my xml. It's being used within DialogVideoInfo.xml. I've tried various strings and infos and none works either in this window or the usual list views. I also tried reinstalling XBMC from scratch to see if that made a difference.

Code:
        <control type="image">
            <posx>7</posx>
            <posy>68</posy>
            <width>166</width>
            <height>38</height>
            <texture>mpaa_restricted.png</texture>
            <visible>substring(listitem.mpaa,Rated R)</visible>
        </control>
Reply
#22
@watsen: good idea.. you could match filename for ex. offline (if you have an offline movie entry)
Reply
#23
Hmm, I've tried everything I can think of with your xml. I can't get it to work either, it works with "for", "violence" and anything after the "Rated R" but not "Rated R" Huh


blittan Wrote:@watsen: good idea.. you could match filename for ex. offline (if you have an offline movie entry)

Yeah that works too. Tested it and it works fine, ListItem.fileandpath to get the full path name
substring(ListItem.fileandpath,offline)
for:
C:\movies\offline\hd\moviename.mkv
  • 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
#24
I have a sneaking suspicion it can't handle capped letters. Hence the "Rated R" not working, as well as my recent attempt of "Bluray". "bluray", however, does work.
Reply
#25
It should be matching case-insensitive, but perhaps it's not.
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
#26
it's maybe the space in between thats causing problems..
Reply
#27
I think I have fixed it(I lowercased both strings) and simplified the "else" with label and compare instead of GetLabel(info.GetData1()) and m_stringParameters[info.GetData2()].

I'll post a patch on the trac.

edit: fixed in svn r16901
  • 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

Logout Mark Read Team Forum Stats Members Help
A strcmp (stringcompare) type function0