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 *
|