Forum Discussion
belltown
10 years agoRoku Guru
I can't help you with the scene graph stuff, but I can tell you that the time formatting code of mine that you copied and changed has two fundamental flaws: you're using dynamic types instead of declared types, so you'll end up with floating values instead of integer values when you divide; and you're using "m", the global BrightScript "this" pointer, as your minutes variable, which will play havoc with anything else in your code that references "m".
Here's the original code:
Here's the original code:
' Format the time left: "h:mm:ss"
Function formatTimeLeft (seconds As Integer) As String
h% = seconds / 3600
m% = (seconds - h% * 3600) / 60
s% = seconds Mod 60
Return h%.ToStr () + ":" + Right ("0" + m%.ToStr (), 2) + ":" + Right ("0" + s%.ToStr (), 2)
End Function