How do we use stringcompare for two labels?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #1
I need to do something like this:

Code:
stringcompare(Skin.String(Delete_Show_Number_1),ListItem.TVShowTitle)

Is this possible? I can get it to prove true if I set it to say:

Code:
stringcompare(Skin.String(Delete_Show_Number_1),Justified)

But I cant use an infolabel. Three hours later, I have no workaround. Anybody got an idea?
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,976
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #2
The second string needs to be formatted differently so XBMC knows it's info and not just a string.

PHP Code:
stringcompare(Skin.String(Delete_Show_Number_1),$INFO[ListItem.TVShowTitle]) 

[Image: sig_zps3af3b48e.jpg]
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #3
Hitcher Wrote:The second string needs to be formatted differently so XBMC knows it's info and not just a string.

PHP Code:
stringcompare(Skin.String(Delete_Show_Number_1),$INFO[ListItem.TVShowTitle]) 

That doesnt work either.
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,976
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #4
Have you checked they're both actually the same by using two separate labels on screen?
Either that or you need to add the container ID -

$INFO[Container(n).ListItem.Label]

[Image: sig_zps3af3b48e.jpg]
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #5
Hitcher Wrote:Have you checked they're both actually the same by using two separate labels on screen?
Either that or you need to add the container ID -

$INFO[Container(n).ListItem.Label]

They are the same label using:

Code:
<control type = "label">
                    <description>header label</description>
                    <posx>510</posx>
                    <posy>20</posy>
                    <width>700</width>
                    <height>30</height>
                    <font>Simplicity_40</font>
                    <label>$INFO[Skin.String(Delete_Show_Number_1)]</label>
                    <align>left</align>
                    <aligny>center</aligny>
                    <textcolor>white</textcolor>
                    <shadowcolor>black</shadowcolor>
                </control>
                <control type = "label">
                    <description>header label</description>
                    <posx>510</posx>
                    <posy>120</posy>
                    <width>700</width>
                    <height>30</height>
                    <font>Simplicity_40</font>
                    <label>$INFO[ListItem.TVShowTitle]</label>
                    <align>left</align>
                    <aligny>center</aligny>
                    <textcolor>white</textcolor>
                    <shadowcolor>black</shadowcolor>
                </control>

But when I compare them, I get nothing. I used:

Code:
<include condition="stringcompare(Skin.String(Delete_Show_Number_1),$INFO[Container().ListItem.TVShowTitle])">Delete_Eps</include>
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,976
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #6
You need to put the actual number of the list control in the brackets.

[Image: sig_zps3af3b48e.jpg]
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #7
Hitcher Wrote:You need to put the actual number of the list control in the brackets.

Nope. This is driving me crazy!

Code:
<include condition="stringcompare(Skin.String(Delete_Show_Number_1),$INFO[Container(532).ListItem.TVShowTitle])">Delete_Eps</include>
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,976
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #8
Stick both those labels outside of everything else and see what they return.

EDIT: Only just noticed you're using this as an include condition which could be the problem because include conditions are only checked once on loading the current window.

[Image: sig_zps3af3b48e.jpg]
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #9
Hitcher Wrote:Stick both those labels outside of everything else and see what they return.

EDIT: Only just noticed you're using this as an include condition which could be the problem because include conditions are only checked once on loading the current window.

I stuck them outside and they return the same values. You think its the include? Is there a workaround?
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,976
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #10
Well it will only do the compare when you load MyVideoNav.xml so more than likely.

[Image: sig_zps3af3b48e.jpg]
find quote
Post Reply