Maintain System Creation Date (GRX)
John Esak
john at valar.com
Fri Mar 26 15:07:27 PDT 2010
Chris,
My hat is off to you... That is without doubt an incredible use of filePro
or any program to get something done. So, seriously, and really my
compliments.
It is another amazing tribute to the thing I've said since I first saw
Profile... It pretty much can do anything you can think of... It's my
favorite thing about filePro, that anyone who puts in a little effort can
get his job done, no matter whether he is told by everyone It CAN'T BE DONE
or not... And whether they are a programmer or not. They just need to use
their mind and put the tools they know to work.
Now, for the answer I am compelled to give. While your solution works and
you are aware of the drawbacks of changing the system time, so you only do
it at night.... Still, suggesting that others try this is probably not what
you want to do. For a Unix system, this would certainly work (or a tiny
variant of it), but it would be pure anathema to any system administrator.
You should just never, ever, do anything like that. Again, if you're on a
single user system and hve that much control, you can do whatever you need
and want to do. Like I say kudos... But before you do that again, I would
be happy to whip up a couple lines of code for you that would do this
without any chance of devastation or problem. It would only be a matter of
"WRITING" the free record you just got to which you just did the LOOKUP and
COPY. Then before leaving the record use some quick file I/O to get that
newly created record and use the xxxBUF(16|32) commands in filePro to place
the correct system date into the header of each record. I'll think about it
next week sometime... It isn't "real" hard, but there are a couple gotchas
you need to get around... But it is way safer than what you're doing... I
cn't put any brain power on it now... I've got lots of stuff planned for
tonight and this weekend. Monday, if someone hasn't posted the code
already... I'll attack it and post it soon thereafter. I must have missed
your original query, or just overlooked it when you first posted it, sorry.
But really, that is a very creative and obviously workable thing you've come
up with.. I just cringe at the blood vessels it will be popping in half the
old-timers of this forum. :-)
John
> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
m] On Behalf Of Chris Sellitto
> Sent: Friday, March 26, 2010 5:42 PM
> To: filepro-list at lists.celestial.com
> Subject: Maintain System Creation Date (GRX)
>
> All,
>
> A while back I had posted about retaining the @cd date when
> doing an archive, and suggested that fileProR have some sort
> of switch on the copy command that would retain this value.
> Well fast forward to today. We had a need to retain this
> date again, and I came up with a way that worked for us.
> Maybe someone has already done this in fileProR, but I have
> not seen it yet.
>
> I have only tried this in a Windows environment.
>
> What we did is in our code we set up a counter to increment
> by 1 every time we get a new record. Only when the counter
> equals 1 do we save the current date in a dummy variable.
> Then for every record we save the @cd date of the current
> record in a dummy variable. We then immediately issue the
> fileProR system command issuing a "DATE" command concatenated
> with the @cd dummy variable. This will change the system
> date of the machine to that @cd date. Then we do a free
> record lookup, and copy the current record to the new file,
> which now has the old @cd date attached to it. When the
> process is complete, just do an @done, and set the date back
> to the original date from when you started, and everything is
> back to normal.
>
> This actually worked. And it seemed almost too easy.
>
> Of course this process would be run off hours as to not
> affect anyone on the system. But that is when we do our
> archives anyway.
>
> It may not be the best way of achieving this task, but it
> does work. Hope it works for somebody else.
>
> Just a sample.......
>
>
> LABEL D E F I N E P R O C E S S I N G
> 5.0.14RN
> --------------------------------------------------------------
> -----------------
> 1 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: ct(8,.0,g)=ct+"1"
> 2 ------- - - - - - - - - - - - -
> - - - -
> ? If: ct eq "1"
> Then: sd(8,mdy/,g)=@td
> 3 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: ds(8,mdy/)=@cd
> 4 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: system "date"<ds
> 5 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: lookup temp = gr_vend at temp r=free -e
> 6 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: copy temp
> 7 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: end
> 8 ------- - - - - - - - - - - - -
> - - - -
> @done ? If:
> Then:
> 9 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: system "date"<sd
> 10 ------- - - - - - - - - - - - -
> - - - -
> ? If:
> Then: end
>
>
> Christopher Sellitto
> VP Computer Operations
> Guaranteed ReturnsR
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list