Hi Lee,

> I am using the following script, but the variable 'difference' is
> being set to odd values -
> (I was expecting the format to be the same as that of 'the long time').

  'the long time' return you a string
you should use 'the milliseconds', that will return you an integer (which
value is the number of milliseconds since the computer - or the OS - has
started ... IIRC)

 Using these integer values enable youto manipulate them using arithmetic
operators (-, +)
And if you want to see this difference in a more 'elegant and end-user
friendly', ehere comes a little movie script that will do all you want
easily:

here is a little sample done in the message window:
  put the milliseconds
  -- 51513422
  nTime1 = the milliseconds
  -- here I wait a few seconds
  nTime2 = the milliseconds
  put nTime2-nTime1
  -- 14481
  put MillisecondsToReadableTime(nTime2-nTime1)
  -- " 00:00:14.48 "
  put MillisecondsToReadableTime(nTime2-nTime1, #mmss)
  -- "00:14"


on MillisecondsToReadableTime (nTime, yFormat) -----------------------
  --
  -- INPUTS : nTime: #integer : the milliseconds amount to convert to
  --                  a readable time string
  --          {yFormat} #symbol in the following list
  --                     #hhmmsscc <- default
  --                     #hhmmss
  --                     #hhmm
  --                     #mmsscc
  --                     #mmss
  --
  -- framesToHMS tip by James Newton [[EMAIL PROTECTED]]
  -------

  tTime = framesToHMS(nTime, 1000, 0, 1)
  case yFormat of
    #hhmmsscc: strTime = ""& tTime
    #hhmmss:   strTime = ""& tTime.char[1..9]
    #hhmm:     strTime = ""& tTime.char[1..7]
    #mmsscc:   strTime = ""& tTime.char[5..11]
    #mmss:     strTime = ""& tTime.char[5..9]
    otherwise: strTime = ""& tTime
  end case

  return strTime
end -- MillisecondsToReadableTime


hope this helps,
.s�b

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to