× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



hey all,

I rolled my own elapse time calcs, and i'm having problems.

given the following code...

D $StrTime        S               z
D $NewTime        S               z
D F1Elapse        S              7s 0

D DSelapse        ds
D  $HH                           3s 0     inz
D  $MM                           2s 0     inz
D  $SS                           2s 0     inz
...
C                   time                    $StrTime
...
C                   time                    $NewTime
C                   eval      $HH = %diff($StrTime:$NewTime:*h)
C                   eval      $MM = %diff($StrTime:$NewTime:*m) -
C                                   ($HH*60)
C                   eval      $SS = %diff($StrTime:$NewTime:*s) -
C                                   (($HH*3600) + ($MM*60))
C                   move      DSelapse      F1Elapse

since the %diff bif always rounds down, I thought this would work fine -
but ti's not working.

after 60 seconds, I should have gotten 1 in $MM.  but I'm not.  I get 0,
which causes $SS to be over 60 seconds.  after 99 secs, i get an overflow
error.

why isn't $MM recording 1 minute after 60 secs?  what am i missing?

thanks,

Rick


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.