---- Original Message ----
From: "Donna Garverick" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, May 20, 2003 10:55 PM
Subject: Re: [HP3000-L] determining a file's age
> Carro Arrubarrena Mariano wrote:
>> If you have MPEX, you can do this.
>> Purge @.group.account (credate < today-30)
> i guess i didn't say it clearly.....
> yes, i have mpex. and yes, i know about (credate < blah). but none
> of that answers my question. if foobar was created yesterday, it's
> age (and this is what i'm after) is 1 (day old). - d
Just for (pure mpe) grins, and all in eecummingscase for those with no shift
key on their keyboards :-) :
daysgone.cmd
parm dg
setvar dgyear, str('![finfo('!dg',-8)]',1,4)
setvar dgmonth, str('![finfo('!dg',-8)]',5,2)
setvar dgday, str('![finfo('!dg',-8)]',7,2)
setvar dgdaysold, (365250*(!hpyyyy - !dgyear) + 30500*(!hpmonth -
!dgmonth))/1000 + !hpdate - !dgday
calc '!dg is !dgdaysold days old'
It might be a bit patchy over month ends, especially in early March, but it
works fine unless you want better than 2-3 day accuracy all year round....
:-)
I guess we really need JULIAN and CALDATE as MPE functions, don't we?
Incidentally (as you might gather), I put the above together a step at a
time, initially having:
setvar dgdate, finfo('!dg',-8)
and then getting dgyear by:
setvar dgyear, str('!dgdate',1,4)
which was fine once I got the quotes right...
then I progressed to getting dgyear in one go, which needs the ![<exp>]
syntax, AFAICS...
but then I decided that I'd get dgdaysold from a calculation of the form:
setvar dgdaysold, (!dgyeard+!dgmonthd)/1000 +!dgdayd
which needs elements for dgyeard, etc, which I thought I could get in a way
something like:
setvar dgyeard, 365250*(!hpyyyy - ![str('![finfo('!dg',-8)]',1,4)])
but this doesn't work, so I did dgdaysold as above. Which is fine as far as
it goes.
But AAMOI, does anyone know the line that would get dgyeard from hpyyyy and
dg, as I envisaged above?
I can't find a way except by using nested !{<exp>], and nested !{<exp>]
doesn't seem to work like I think it should :-(
Is it me, or it is MPE at fault? ( :-) )
--
OE-QuoteFix 1.19.1 doing what it can to render the OExperience bearable.
Sig seps are fixed in the updated OE6, but they won't let me load it :-(
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|