This is exactly what I wanted to do!  Thanks :-)

-Garrett

On Dec 19, 2005, at 11:40 AM, Bill Marriott wrote:

There is no built-in function, but the custom function below (place it in
the stack script) should get you started:

===================================

function ConvertSeconds mySecondsTime

  if isNumber(mySecondsTime) then

    -- 3600 seconds in an hour
    put the trunc of (mySecondsTime / 3600) into myHours
    if myHours < 10 then put "0" before myHours -- leading zero

    -- 60 seconds in a minute
    put the trunc of ((mySecondsTime - (3600 * myHours)) / 60) into
myMinutes
    if myMinutes < 10 then put "0" before MyMinutes -- leading zero

    -- the remainder is seconds
    put mySecondsTime - 3600 * myHours - 60 * myMinutes into mySeconds
    if mySeconds < 10 then put "0" before MySeconds -- leading zero
    return myHours & ":" & myMinutes & ":" & mySeconds

  else

    return "Error: ConvertSeconds() requires a number"

  end if

end ConvertSeconds

===================================

From this you can use ConvertSeconds(number) from any handler in the stack
to get the result you want.

Example:

ConvertSeconds(60) returns "00:01:00"
ConvertSeconds(121.5) returns "00:02:01.5"

- Bill

[snip]

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to