Kodi Community Forum

Full Version: How can I set numeric skin variable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I set numeric skin variable?
Skin.SetNumeric(test,207) for ex. does not work.
And how can we read it back because there is no Skin.Numeric().
tried to achieve in this way:
PHP Code:
<control type="button">
            <
label>$LOCALIZE[test]</label>
            <
onclick>Skin.SetNumeric(test,207)</onclick>            
</
control

but no help.

Thanks
Try Skin.String(...).
That is not working under $LOCALIZE:
PHP Code:
<control type="button">
            <
label>$LOCALIZE[Skin.String(test)]</label>
            <
onclick>Skin.SetNumeric(test,207)</onclick>            
</
control

perhaps because $LOCALIZE expects integer but here it is string
(2012-10-17, 13:35)slinuxgeek Wrote: [ -> ]perhaps because $LOCALIZE expects integer but here it is string

Exactly. So you have to find another way until integer variables are supported.

There is Skin.SetNumeric( ) but not the Skin.Numeric( ) for reading that back, also Skin.SetNumeric( ) is not correctly defined as it always opens numeric dialog.

can we convert a string to numeric in skin?
Skin.SetNumeric(...) is the same as Skin.SetString(...). Only difference is that it opens the numeric dialog instead of the keyboard.
no no, Skin.SetNumeric(...) always opens numeric dialog even if we pass the 2nd argument which is not the case with Skin.SetString(...)
Still it sets only a string, no integer value and you can get the value with Skin.String(...).