Kodi Community Forum

Full Version: How do you test a $VAR for a particular string
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This may seem an obvious question.

In the skin I am using there is a variable (FocusedPosterThumbVar) which contains the path to the artwork for the focused container item.  What I need to do is test whether that variable is on any particular item set to "DefaultFolder.png"

The problem is that the obvious code would be "String.IsEqual($VAR[FocusedPosterThumbVar],DefaultFolder.png) does not work.  How would I solve this problem
String.EndsWith($VAR[FocusedPosterThumbVar],DefaultFolder.png)?
without seeing what you are seeing, what about String.Contains?

perhaps the code using the $VAR is using a default="DefaultFolder.png" and you actually need to check String.IsEmpty?
(2023-09-23, 18:15)Hitcher Wrote: [ -> ]String.EndsWith($VAR[FocusedPosterThumbVar],DefaultFolder.png)?

You can't use $VAR in a string comparison Sad
Quote:<variable name="test">
    <value>helloworld</value>
</variable>

<control type="label">
    <visible>String.IsEqual($VAR[test],helloworld)</visible>
    <label>Hello World</label>
</control>
This control is never visible.

@justin150 What do you need to happen when the $VAR contains DefaultFolder.png? There may be another way to solve the problem.
Put it in a label control with an ID and then use String.EndsWith($INFO[Control.GetLabel(label_id),DefaultFolder.png)?