Yesterday I wrote:
...
> To get the ending time, which will need to be converted to a 24 hour
> clock, you can:
> setvar ampm word(file_record,,-1)
> setvar hour decimal(word(file_record,,-2))
> if ampm = "PM" then
> setvar hour hour+12
> endif
>
> finally:
> if hphour > hour then ....
As mentioned previously my conversion from AM/PM to a 24 hour clock is
wrong for 12 and will require extra coding. Also I misused the decimal
function above.
HELP decimal reveals that decimal is a string function, meaning it
returns a string value. We want the HOUR variable to be an integer so it
can be added to and compared to HPHOUR. Instead, this will work:
setvar hour ![word(file_record,,-2)]
A more accurate solution is now:
setvar ampm word(file_record,,-1)
setvar hour ![word(file_record,,-2)]
if ampm = "PM" then
if hour <> 12 then
setvar hour hour+12
endif
elseif hour = 12 then
setvar hour 0
endif
Regards,
Jeff Vance, vCSY
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|