Not sure how to do this, I've tried and it gave me a circular dependency error.
can I assign a variable as a function? e.g.:
var AAA = TODLabel;
var TODLabel = "TOD";
var BBB = CalcTOD();
...
...
function CalcTOD() {
var clockTime = Sys.getClockTime();
...
TOD = Lang.format("$1$:$2$",[hour, min.format("%02d")]);
Return TOD;
}
function onUpdate() {
// This works. it substitutes AAA with TODLabel and it correctly comes up as "TOD"
dc.drawText(65, 15, Gfx.FONT_XTINY, AAA,Gfx.TEXT_JUSTIFY_CENTER);
// This does not work. It gives me the Circular Dependency Error
dc.drawText(65, 15, Gfx.FONT_XTINY, BBB, Gfx.TEXT_JUSTIFY_CENTER);
// This is the original - which works fine.
dc.drawText(65, 15, Gfx.FONT_XTINY, CalcTOD(), Gfx.TEXT_JUSTIFY_CENTER);
}