Armando wrote:
When XWidget restarts,
%LifeTime change to ${LifeTime}
But seems it's work anyway. It's a bit slow to change... but... works.
try %LifeTime in code maybe it works faster;
and maybe it doesn't change to ${LifeTime} in code;
to set a core tag for the object in the code use this:
text1.Coreformat="%LifeTime"
also if you need:
to get the value of a tag from a core in the code use this:
batterycore1.get("%LifeTime")
============
Armando wrote:
1) shows the minutes not divided in hours (eg.: 157 minutes) ... (do not know how you become with code to hours and minutes ...).
you can use like this in code to make it [hour:minute]
Code:
mp=parseInt("157minutes",10)
h1=parseInt(mp/60,10)
m1=parseInt(mp%60,10)
text1.text=h1+":"+m1
you can use your own statement instead of "157minutes" in mp line:
ex: using a tag:
mp=parseInt( batterycore1.get("%LifeTime") , 10 )
or
ex: using a variable:
bm=batterycore1.get("%LifeTime")
mp=parseInt( bm , 10 )
----------------
and also if needed you should add the code to a [if] statement,
since i don't have battery i don't know when it displays in minutes.
---------------
Note:
parseInt( numString , Radix ): A function that will make its input to int
-numString: the String you want to make int
-Radix: the numeral system to be used (it can be from 2-36); use 10 for decimal system
ex: float>int:
parseInt(12.157,10) >>> 12
ex: char>int:
parseInt(123abcd,10) >>> 123
ex: float&chars>int:
parseInt(153.12abcd,10) >>> 153
==================