Please see the info that I provided above.
The point is that to avoid overflow the calculations need to be made with LongInteger values rather than Integer values.
In a calculation with 2 Integer values (+, -, *, /, \, Mod) the result will also be an Integer value.
However if one or both of the values is a LongInteger, the calculation and value will be a LongInteger value.
totalMilliSeconds = (seconds * 1000) + milliSecondsPart
^ This calculation is done with all Integer (32-bit) values, so will overflow with large values.
totalMilliSeconds = (seconds * 1000&) + milliSecondsPart
If you do this instead, the "1000&" denotes a LongInteger (64-bit) constant, which promotes the calculation to be done in that extended range, so it should not overflow.
https://developer.roku.com/docs/references/brightscript/language/expressions-variables-types.md#nume...
Hope that helps!