Adding Time

Jim Lambert jiml at netrin.com
Mon Oct 30 17:02:07 EST 2006


This MAY be a tad faster.

Jiim Lambert

on mouseUp
   local tTimeList
   -----
   put BuildTimeList(fld "StartTime", fld "EndTime", fld "Interval")  into
tTimeList
   if tTimeList contains "error" then
     -- error handling
   else put tTimeList into fld "TimeList"
end mouseUp
--------------------------------------------
function BuildTimeList pStartime,pEndtime,pInterval
  local tTimeList
  -----
  put pInterval * 60 into pInterval
  convert pStartime from short time to seconds
  convert pEndtime from short time to seconds
  if pEndtime <= pStartime then return "Error: invalid time period"
  -----
  repeat until pStartime > pEndtime
    put pStartime into temp
    convert temp from seconds to short time
    put temp & cr after tTimeList
    add pInterval to pStartime
  end repeat
  -----
  delete char -1 of tTimeList
  return tTimeList
end BuildTimeList




More information about the use-livecode mailing list