HP3000-L Archives

August 2005, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Vance, Jeff H (Cupertino)" <[log in to unmask]>
Reply To:
Vance, Jeff H (Cupertino)
Date:
Wed, 17 Aug 2005 10:32:07 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
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 *

ATOM RSS1 RSS2