Adding Time

Eric Chatonet eric.chatonet at sosmartsoftware.com
Mon Oct 30 16:00:21 EST 2006


Hi jhonken,

Here is another approach:

on mouseUp
   put BuildTimeList(fld "StartTime", fld "EndTime", fld "Interval")  
into fld "TimeList"
end mouseUp
--------------------------------------------
function BuildTimeList tStartime,tEndtime,tInterval
   local tTimeList
   -----
   put tInterval * 60 onto tInterval
   convert tStartime from short time to seconds
   convert tEndtime from short time to seconds
   -----
   repeat until tStartime > tEndtime
     convert tStartime from seconds to short time
     put tStartime & cr after tTimeList
     convert tStartime from short time to seconds
     add tInterval to tStartime
   end repeat
   -----
   delete char -1 of tTimeList
   return tTimeList
end BuildTimeList

It assumes that "StartTime" and "EndTime" fields are formatted as  
short English date and field "Interval" is an integer that means  
minutes.

Best Regards from Paris,
Eric Chatonet

Le 30 oct. 06 à 20:27, jhonken a écrit :

> Can anyone steer me in the correct direction for this?  What I need to
> do is populate a list box with times at specific intervals.  i.e.
>
> I have a input box for the start time say 8:00 A.M.
> I have a input box that has a stop time say 5:00 P.M.
> I have a input box that has an interval say 5 minutes.
>
> What I want to do is populate a list box with:
>
> 8:00 A.M.
> 8:05 A.M.
> 8:10 A.M.
> etc.
> etc.
> etc.
> 5:00 P.M.
>
> Any help would be greatly appreciated.


------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list