HP3000-L Archives

February 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:
Paul Christidis <[log in to unmask]>
Reply To:
Date:
Mon, 21 Feb 2005 10:59:24 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (53 lines)
Greg,

Try the following:
:setvar a SETVAR(b, 30+hpminute+(60*hphour))+SETVAR(newh,(b/60)mod
24)+SETVAR(newm,(b mod 60)

See example below:

:showvar hphour, hpminute
HPHOUR = 10
HPMINUTE = 54

:setvar a SETVAR(b, 30+hpminute+(60*hphour))+SETVAR(newh,(b/60)mod
24)+SETVAR(newm,(b mod 60))
:showvar new@
NEWH = 11
NEWM = 24

The above should also work across date changes..


Regards
Paul Christidis


HP-3000 Systems Discussion <[log in to unmask]> wrote on 02/19/2005
03:32:43 PM:

> > If HPMINUTE > 30 then you'd have to add some checking and math,
something
> > like
> > and IF ... THEN ... ELSE check to subtract 30 from the minutes and add
1
> > to the
> > hour.
> which is what I am trying to avoid having to do. I thought that maybe
there
> was some way to perhaps both add and subtract a value, and then take the
> absolute value of the result, or something cunning like that. I want to
> calculate once, not evaluate and then calculate, if you follow my
meaning.
> Again, best I've come up with is ((hour x 60) + 30) / 60 for the hour,
and
> mod ((hour x 60) + 30) 60 for the minutes.
>
> Greg Stigers
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2