I've been hunting for a simple function to convert a TIME value (e.g.
10:15) to a REAL value (e.g. 10.25), to make "elapsed time math" easy.
Something like: (DTIME(.vTimeValue)) ... which I'm not seeing.
This would reduce elapsed-TIME calculations to:
SET VAR vTime_End_DOUBLE = (DTIME(.vTime_End_TIME))
SET VAR vTime_Beg_DOUBLE = (DTIME(.vTime_Beg_TIME))
SET VAR vTime_Elapsed_DOUBLE = (.vTime_End_DOUBLE - .vTime_Beg_DOUBLE)
I'm absolutely sure I'm just missing something insanely simple.
Meanwhile, something like Footnote [1] does the job, but forget about
putting it in a Calculated Column Definition, which is the best place
for such a basic calculation.
??
Thanks, Bruce
Bruce A. Chitiea
SafeSectors, Inc.
-----------------------------------
112 Harvard Ave #272
Claremont CA 91711-4716
-----------------------------------
rby...@safesectors.com
-----------------------------------
+011 (909) 238-9012 c
+011 (909) 912-8678 f
[1] Not elegant, but it works:
SET VAR vTime_Beg TIME = NULL
SET VAR vTime_End TIME = NULL
SET VAR vTime_Elapsed DOUBLE = NULL
SET VAR vTime_Beg_IHR INT = NULL
SET VAR vTime_Beg_IMIN INT = NULL
SET VAR vTime_Beg_DMIN DOUBLE = NULL
SET VAR vTime_End_IHR INT = NULL
SET VAR vTime_End_IMIN INT = NULL
SET VAR vTime_End_DMIN DOUBLE = NULL
SET VAR vTime_End = 13:30
SET VAR vTime_Beg = 10:15
SET VAR vTime_Beg_IHR = (IHR(.vTime_Beg))
SET VAR vTime_Beg_IMIN = (IMIN(.vTime_Beg))
SET VAR vTime_Beg_DMIN = (.vTime_Beg_IMIN/60)
SET VAR vTime_End_IHR = (IHR(.vTime_End))
SET VAR vTime_End_IMIN = (IMIN(.vTime_End))
SET VAR vTime_End_DMIN = (.vTime_End_IMIN/60)
SET VAR vTime_Beg_DEC = (.vTime_Beg_IHR + .vTime_Beg_DMIN)
SET VAR vTime_End_DEC = (.vTime_End_IHR + .vTime_End_DMIN)
SET VAR vTime_Elapsed = (.vTime_End_DEC - .vTime_Beg_DEC)
WRITE .vTime_Beg_IHR
WRITE .vTime_Beg_IMIN
WRITE .vTime_Beg_DMIN
WRITE .vTime_Beg_DEC
WRITE ' '
WRITE .vTime_End_IHR
WRITE .vTime_End_IMIN
WRITE .vTime_End_DMIN
WRITE .vTime_End_DEC
WRITE ' '
WRITE .vTime_Elapsed
RETURN
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/emd7e644de-7035-4588-b4ef-1d6053f7916b%40pathfinder.