Elasped Time past 24 hours 
Author Message
 Elasped Time past 24 hours

 Need some help with a little problem.  I'm using Clarion Professional
Developer 2.111(DOS).

Elapsed time fields are great as long as you don't exceed 24 hours.
However, I would like to be able to "break the barrier." The following
code uses a string field and both the hours & minutes work fine. The
seconds are not working properly. Depending on how the positions are
set, it will work either in the first 24 hours or the second day. This
seems like the hard way.  I tried using the % operator but I would keep
getting -60.002405, no matter what numbers I used.  It probably
issomething very simple, but I can't figure it out. The end result will
be displayed in hh:mm:ss.

 Hope you can help.

 Thanks,

 Dave Walter

   HOURS:
   IF rac:finish_c>0                              !EVALUATE CONDITION
     TBL:TEST = INT(rac:finish_c/360000)          !  CONDITION IS TRUE
   ELSE                                           !OTHERWISE
   .

 MINUTES:
   IF rac:finish_c<3599900                        !EVALUATE CONDITION
     TBL:TEST1 = INT(sub((RAC:FINISH_C/360000),2,6)/.0166666)!CONDITION
 IS TRUE
   ELSE                                           !OTHERWISE
     TBL:TEST1 = INT(sub((rac:finish_c/360000),3,6)/.016666)!CONDITION
IS
 FALSE
   .

 SECONDS:
   IF INT(sub((rac:finish_c/360000),2,6)/.016666)<10 !EVALUATE CONDITION
     TBL:TEST3 =
 INT(sub((sub((rac:finish_c/360000),2,6)/.016666),2,6)/.01666)!CO
   ELSE                                               !OTHERWISE
     TBL:TEST3 =
 INT(sub((sub((rac:finish_c/360000),3,6)/.016666),3,6)/.01666)!CO
   .



Fri, 23 Apr 1999 03:00:00 GMT  
 Elasped Time past 24 hours

I think this will give you what you want

      IF CLOCK() < LOC:BgnTime
         LOC:ElpTime   = 8640000 - LOC:BgnTime + CLOCK()
      ELSE
         LOC:ElpTime   = CLOCK() - LOC:BgnTime
      END

Your calculations seem a little too complicated!

Quote:
> Subject: Elasped Time past 24 hours
> Date: Tue, 05 Nov 1996 00:31:24 -0800

> Organization: dbonics.Inc.



>  Need some help with a little problem.  I'm using Clarion Professional
> Developer 2.111(DOS).

> Elapsed time fields are great as long as you don't exceed 24 hours.
> However, I would like to be able to "break the barrier." The following
> code uses a string field and both the hours & minutes work fine. The
> seconds are not working properly. Depending on how the positions are
> set, it will work either in the first 24 hours or the second day. This
> seems like the hard way.  I tried using the % operator but I would keep
> getting -60.002405, no matter what numbers I used.  It probably
> issomething very simple, but I can't figure it out. The end result will
> be displayed in hh:mm:ss.

>  Hope you can help.

>  Thanks,

>  Dave Walter

>    HOURS:
>    IF rac:finish_c>0                              !EVALUATE CONDITION
>      TBL:TEST = INT(rac:finish_c/360000)          !  CONDITION IS TRUE
>    ELSE                                           !OTHERWISE
>    .

>  MINUTES:
>    IF rac:finish_c<3599900                        !EVALUATE CONDITION
>      TBL:TEST1 = INT(sub((RAC:FINISH_C/360000),2,6)/.0166666)!CONDITION
>  IS TRUE
>    ELSE                                           !OTHERWISE
>      TBL:TEST1 = INT(sub((rac:finish_c/360000),3,6)/.016666)!CONDITION
> IS
>  FALSE
>    .

>  SECONDS:
>    IF INT(sub((rac:finish_c/360000),2,6)/.016666)<10 !EVALUATE CONDITION
>      TBL:TEST3 =
>  INT(sub((sub((rac:finish_c/360000),2,6)/.016666),2,6)/.01666)!CO
>    ELSE                                               !OTHERWISE
>      TBL:TEST3 =
>  INT(sub((sub((rac:finish_c/360000),3,6)/.016666),3,6)/.01666)!CO
>    .

--
=========================================================


    "Begin a new era of productivity;
     leave the mundane aspects of programming to us!"
=========================================================



Sat, 24 Apr 1999 03:00:00 GMT  
 Elasped Time past 24 hours

Hi Dave

I may not understand what you are trying to accomplish but couldn't
you store the start DATE and TIME and then store the ending DATE and
TIME then subtract.  Then display something like:

"Elapsed Time     1 Day    2 Hours  38 Mins 15 Secs"

or even a check like:
  ElapsedDays = EndDate - StartDate
  If ElapsedDays > 0
     ElapsedHours += ElapsedDays * 24
  END

Regards........Wayne

Quote:
> Date:          Tue, 05 Nov 1996 00:31:24 -0800

> Organization:  dbonics.Inc.

> Subject:       Elasped Time past 24 hours

>  Need some help with a little problem.  I'm using Clarion Professional
> Developer 2.111(DOS).

> Elapsed time fields are great as long as you don't exceed 24 hours.
> However, I would like to be able to "break the barrier." The following
> code uses a string field and both the hours & minutes work fine. The
> seconds are not working properly. Depending on how the positions are
> set, it will work either in the first 24 hours or the second day. This
> seems like the hard way.  I tried using the % operator but I would keep
> getting -60.002405, no matter what numbers I used.  It probably
> issomething very simple, but I can't figure it out. The end result will
> be displayed in hh:mm:ss.

>  Hope you can help.

>  Thanks,

>  Dave Walter

>    HOURS:
>    IF rac:finish_c>0                              !EVALUATE CONDITION
>      TBL:TEST = INT(rac:finish_c/360000)          !  CONDITION IS TRUE
>    ELSE                                           !OTHERWISE
>    .

>  MINUTES:
>    IF rac:finish_c<3599900                        !EVALUATE CONDITION
>      TBL:TEST1 = INT(sub((RAC:FINISH_C/360000),2,6)/.0166666)!CONDITION
>  IS TRUE
>    ELSE                                           !OTHERWISE
>      TBL:TEST1 = INT(sub((rac:finish_c/360000),3,6)/.016666)!CONDITION
> IS
>  FALSE
>    .

>  SECONDS:
>    IF INT(sub((rac:finish_c/360000),2,6)/.016666)<10 !EVALUATE CONDITION
>      TBL:TEST3 =
>  INT(sub((sub((rac:finish_c/360000),2,6)/.016666),2,6)/.01666)!CO
>    ELSE                                               !OTHERWISE
>      TBL:TEST3 =
>  INT(sub((sub((rac:finish_c/360000),3,6)/.016666),3,6)/.01666)!CO
>    .

_____________________________________________
Thomas Haynes, Madison Alabama
Interesting Opportunity at:
HTTP://www.gldb.com/htm/TWH12434.htm
______________________________________________


Thu, 29 Apr 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP:Measuring CPU time and elasped time of FORTRAN77

2. 50% off sale extended another 24 hours

3. Gitano Software Sites Down for the next 24 hours

4. FA: Jupiter Ace - last 24 hours!

5. Planned 24 hour moderation outage.

6. Less than 24 hours... The Westergaard Y2K Colloquium

7. Teach Yourself COBOL In 24 Hours!

8. Using Learn Cobol 24 Hours by Thane Hubbell

9. TY COBOL in 24 Hours - via Amazon.com

10. Sams Teach Yourself COBOL in 24 Hours

11. Review: Teach Yourself Python in 24 Hours

12. OT: swen-filter version 5 - 100% matches over the last 24 hours for my mailbox

 

 
Powered by phpBB® Forum Software